Avoid unnecessary load-store for out params in SPIR-V.

We don't need to initialize input values for `out` params. (We were
treating them the same as `inout`.)

Change-Id: Ib447d15de237a6a03740ad012180691dc60a50bd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446717
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
diff --git a/src/sksl/codegen/SkSLSPIRVCodeGenerator.cpp b/src/sksl/codegen/SkSLSPIRVCodeGenerator.cpp
index 56f8a63..43f8661 100644
--- a/src/sksl/codegen/SkSLSPIRVCodeGenerator.cpp
+++ b/src/sksl/codegen/SkSLSPIRVCodeGenerator.cpp
@@ -199,6 +199,20 @@
     return (var.modifiers().fFlags & Modifiers::kOut_Flag) != 0;
 }
 
+static bool is_in(const Variable& var) {
+    switch (var.modifiers().fFlags & (Modifiers::kOut_Flag | Modifiers::kIn_Flag)) {
+        case Modifiers::kOut_Flag:                       // out
+            return false;
+
+        case 0:                                          // implicit in
+        case Modifiers::kIn_Flag:                        // explicit in
+        case Modifiers::kOut_Flag | Modifiers::kIn_Flag: // inout
+            return true;
+
+        default: SkUNREACHABLE;
+    }
+}
+
 void SPIRVCodeGenerator::writeOpCode(SpvOp_ opCode, int length, OutputStream& out) {
     SkASSERT(opCode != SpvOpLoad || &out != &fConstantBuffer);
     SkASSERT(opCode != SpvOpUndef);
@@ -1184,7 +1198,7 @@
         // passed directly
         SpvId tmpVar;
         // if we need a temporary var to store this argument, this is the value to store in the var
-        SpvId tmpValueId;
+        SpvId tmpValueId = -1;
         if (is_out(*function.parameters()[i])) {
             std::unique_ptr<LValue> lv = this->getLValue(*arguments[i], out);
             SpvId ptr = lv->getPointer();
@@ -1195,7 +1209,9 @@
                 // lvalue cannot simply be read and written via a pointer (e.g. a swizzle). Need to
                 // copy it into a temp, call the function, read the value out of the temp, and then
                 // update the lvalue.
-                tmpValueId = lv->load(out);
+                if (is_in(*function.parameters()[i])) {
+                    tmpValueId = lv->load(out);
+                }
                 tmpVar = this->nextId(&arguments[i]->type());
                 tempVars.push_back(TempVar{tmpVar, &arguments[i]->type(), std::move(lv)});
             }
@@ -1209,7 +1225,9 @@
                                tmpVar,
                                SpvStorageClassFunction,
                                fVariableBuffer);
-        this->writeInstruction(SpvOpStore, tmpVar, tmpValueId, out);
+        if (tmpValueId != (SpvId)-1) {
+            this->writeInstruction(SpvOpStore, tmpVar, tmpValueId, out);
+        }
         argumentIds.push_back(tmpVar);
     }
     SpvId result = this->nextId(nullptr);
diff --git a/tests/sksl/shared/OutParams.asm.frag b/tests/sksl/shared/OutParams.asm.frag
index 9725234..5621226 100644
--- a/tests/sksl/shared/OutParams.asm.frag
+++ b/tests/sksl/shared/OutParams.asm.frag
@@ -133,64 +133,55 @@
 OpDecorate %h3 RelaxedPrecision
 OpDecorate %h4 RelaxedPrecision
 OpDecorate %254 RelaxedPrecision
-OpDecorate %255 RelaxedPrecision
+OpDecorate %256 RelaxedPrecision
 OpDecorate %257 RelaxedPrecision
-OpDecorate %258 RelaxedPrecision
 OpDecorate %259 RelaxedPrecision
 OpDecorate %260 RelaxedPrecision
+OpDecorate %261 RelaxedPrecision
 OpDecorate %262 RelaxedPrecision
-OpDecorate %263 RelaxedPrecision
 OpDecorate %264 RelaxedPrecision
 OpDecorate %265 RelaxedPrecision
 OpDecorate %266 RelaxedPrecision
-OpDecorate %267 RelaxedPrecision
-OpDecorate %269 RelaxedPrecision
-OpDecorate %270 RelaxedPrecision
-OpDecorate %271 RelaxedPrecision
 OpDecorate %h2x2 RelaxedPrecision
 OpDecorate %h3x3 RelaxedPrecision
 OpDecorate %h4x4 RelaxedPrecision
-OpDecorate %279 RelaxedPrecision
+OpDecorate %274 RelaxedPrecision
+OpDecorate %276 RelaxedPrecision
 OpDecorate %280 RelaxedPrecision
 OpDecorate %282 RelaxedPrecision
 OpDecorate %286 RelaxedPrecision
-OpDecorate %287 RelaxedPrecision
-OpDecorate %289 RelaxedPrecision
-OpDecorate %293 RelaxedPrecision
-OpDecorate %294 RelaxedPrecision
-OpDecorate %296 RelaxedPrecision
+OpDecorate %288 RelaxedPrecision
+OpDecorate %354 RelaxedPrecision
+OpDecorate %358 RelaxedPrecision
+OpDecorate %359 RelaxedPrecision
+OpDecorate %360 RelaxedPrecision
+OpDecorate %361 RelaxedPrecision
+OpDecorate %362 RelaxedPrecision
+OpDecorate %363 RelaxedPrecision
+OpDecorate %364 RelaxedPrecision
 OpDecorate %365 RelaxedPrecision
-OpDecorate %372 RelaxedPrecision
-OpDecorate %376 RelaxedPrecision
+OpDecorate %366 RelaxedPrecision
+OpDecorate %367 RelaxedPrecision
+OpDecorate %369 RelaxedPrecision
+OpDecorate %370 RelaxedPrecision
+OpDecorate %371 RelaxedPrecision
+OpDecorate %373 RelaxedPrecision
+OpDecorate %374 RelaxedPrecision
+OpDecorate %375 RelaxedPrecision
 OpDecorate %377 RelaxedPrecision
 OpDecorate %378 RelaxedPrecision
 OpDecorate %379 RelaxedPrecision
-OpDecorate %380 RelaxedPrecision
-OpDecorate %381 RelaxedPrecision
 OpDecorate %382 RelaxedPrecision
-OpDecorate %383 RelaxedPrecision
-OpDecorate %384 RelaxedPrecision
-OpDecorate %385 RelaxedPrecision
-OpDecorate %387 RelaxedPrecision
-OpDecorate %388 RelaxedPrecision
-OpDecorate %389 RelaxedPrecision
-OpDecorate %391 RelaxedPrecision
-OpDecorate %392 RelaxedPrecision
-OpDecorate %393 RelaxedPrecision
-OpDecorate %395 RelaxedPrecision
-OpDecorate %396 RelaxedPrecision
-OpDecorate %397 RelaxedPrecision
-OpDecorate %400 RelaxedPrecision
+OpDecorate %409 RelaxedPrecision
+OpDecorate %424 RelaxedPrecision
 OpDecorate %427 RelaxedPrecision
-OpDecorate %442 RelaxedPrecision
-OpDecorate %445 RelaxedPrecision
-OpDecorate %448 RelaxedPrecision
+OpDecorate %430 RelaxedPrecision
+OpDecorate %435 RelaxedPrecision
+OpDecorate %440 RelaxedPrecision
+OpDecorate %444 RelaxedPrecision
+OpDecorate %450 RelaxedPrecision
+OpDecorate %452 RelaxedPrecision
 OpDecorate %453 RelaxedPrecision
-OpDecorate %458 RelaxedPrecision
-OpDecorate %462 RelaxedPrecision
-OpDecorate %468 RelaxedPrecision
-OpDecorate %470 RelaxedPrecision
-OpDecorate %471 RelaxedPrecision
 %float = OpTypeFloat 32
 %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -513,281 +504,250 @@
 %h2 = OpVariable %_ptr_Function_v2float Function
 %h3 = OpVariable %_ptr_Function_v3float Function
 %h4 = OpVariable %_ptr_Function_v4float Function
-%255 = OpVariable %_ptr_Function_float Function
-%260 = OpVariable %_ptr_Function_v2float Function
-%267 = OpVariable %_ptr_Function_v4float Function
+%254 = OpVariable %_ptr_Function_float Function
+%257 = OpVariable %_ptr_Function_v2float Function
+%262 = OpVariable %_ptr_Function_v4float Function
 %h2x2 = OpVariable %_ptr_Function_mat2v2float Function
 %h3x3 = OpVariable %_ptr_Function_mat3v3float Function
 %h4x4 = OpVariable %_ptr_Function_mat4v4float Function
-%280 = OpVariable %_ptr_Function_v3float Function
-%287 = OpVariable %_ptr_Function_float Function
-%294 = OpVariable %_ptr_Function_float Function
+%274 = OpVariable %_ptr_Function_v3float Function
+%280 = OpVariable %_ptr_Function_float Function
+%286 = OpVariable %_ptr_Function_float Function
 %i = OpVariable %_ptr_Function_int Function
 %i2 = OpVariable %_ptr_Function_v2int Function
 %i3 = OpVariable %_ptr_Function_v3int Function
 %i4 = OpVariable %_ptr_Function_v4int Function
-%307 = OpVariable %_ptr_Function_v3int Function
-%314 = OpVariable %_ptr_Function_int Function
+%297 = OpVariable %_ptr_Function_v3int Function
+%303 = OpVariable %_ptr_Function_int Function
 %f = OpVariable %_ptr_Function_float Function
 %f2 = OpVariable %_ptr_Function_v2float Function
 %f3 = OpVariable %_ptr_Function_v3float Function
 %f4 = OpVariable %_ptr_Function_v4float Function
-%327 = OpVariable %_ptr_Function_v2float Function
-%334 = OpVariable %_ptr_Function_float Function
+%314 = OpVariable %_ptr_Function_v2float Function
+%320 = OpVariable %_ptr_Function_float Function
 %f2x2 = OpVariable %_ptr_Function_mat2v2float Function
 %f3x3 = OpVariable %_ptr_Function_mat3v3float Function
 %f4x4 = OpVariable %_ptr_Function_mat4v4float Function
-%346 = OpVariable %_ptr_Function_float Function
+%331 = OpVariable %_ptr_Function_float Function
 %b = OpVariable %_ptr_Function_bool Function
 %b2 = OpVariable %_ptr_Function_v2bool Function
 %b3 = OpVariable %_ptr_Function_v3bool Function
 %b4 = OpVariable %_ptr_Function_v4bool Function
-%359 = OpVariable %_ptr_Function_v2bool Function
-%366 = OpVariable %_ptr_Function_bool Function
+%342 = OpVariable %_ptr_Function_v2bool Function
+%348 = OpVariable %_ptr_Function_bool Function
 %ok = OpVariable %_ptr_Function_bool Function
-%463 = OpVariable %_ptr_Function_v4float Function
+%445 = OpVariable %_ptr_Function_v4float Function
 %245 = OpFunctionCall %void %out_half_vh %h
 %247 = OpFunctionCall %void %out_half2_vh2 %h2
 %249 = OpFunctionCall %void %out_half3_vh3 %h3
 %251 = OpFunctionCall %void %out_half4_vh4 %h4
 %252 = OpAccessChain %_ptr_Function_float %h3 %int_1
-%254 = OpLoad %float %252
-OpStore %255 %254
-%256 = OpFunctionCall %void %out_half_vh %255
-%257 = OpLoad %float %255
-OpStore %252 %257
-%258 = OpLoad %v3float %h3
-%259 = OpVectorShuffle %v2float %258 %258 0 2
-OpStore %260 %259
-%261 = OpFunctionCall %void %out_half2_vh2 %260
-%262 = OpLoad %v2float %260
-%263 = OpLoad %v3float %h3
-%264 = OpVectorShuffle %v3float %263 %262 3 1 4
-OpStore %h3 %264
+%255 = OpFunctionCall %void %out_half_vh %254
+%256 = OpLoad %float %254
+OpStore %252 %256
+%258 = OpFunctionCall %void %out_half2_vh2 %257
+%259 = OpLoad %v2float %257
+%260 = OpLoad %v3float %h3
+%261 = OpVectorShuffle %v3float %260 %259 3 1 4
+OpStore %h3 %261
+%263 = OpFunctionCall %void %out_half4_vh4 %262
+%264 = OpLoad %v4float %262
 %265 = OpLoad %v4float %h4
-%266 = OpVectorShuffle %v4float %265 %265 2 3 0 1
-OpStore %267 %266
-%268 = OpFunctionCall %void %out_half4_vh4 %267
-%269 = OpLoad %v4float %267
-%270 = OpLoad %v4float %h4
-%271 = OpVectorShuffle %v4float %270 %269 6 7 4 5
-OpStore %h4 %271
-%273 = OpFunctionCall %void %out_half2x2_vh22 %h2x2
-%275 = OpFunctionCall %void %out_half3x3_vh33 %h3x3
-%277 = OpFunctionCall %void %out_half4x4_vh44 %h4x4
-%278 = OpAccessChain %_ptr_Function_v3float %h3x3 %int_1
-%279 = OpLoad %v3float %278
-OpStore %280 %279
-%281 = OpFunctionCall %void %out_half3_vh3 %280
-%282 = OpLoad %v3float %280
-OpStore %278 %282
-%284 = OpAccessChain %_ptr_Function_v4float %h4x4 %int_3
-%285 = OpAccessChain %_ptr_Function_float %284 %int_3
-%286 = OpLoad %float %285
-OpStore %287 %286
-%288 = OpFunctionCall %void %out_half_vh %287
-%289 = OpLoad %float %287
-OpStore %285 %289
-%291 = OpAccessChain %_ptr_Function_v2float %h2x2 %int_0
-%292 = OpAccessChain %_ptr_Function_float %291 %int_0
-%293 = OpLoad %float %292
-OpStore %294 %293
-%295 = OpFunctionCall %void %out_half_vh %294
-%296 = OpLoad %float %294
-OpStore %292 %296
-%298 = OpFunctionCall %void %out_int_vi %i
-%300 = OpFunctionCall %void %out_int2_vi2 %i2
-%302 = OpFunctionCall %void %out_int3_vi3 %i3
-%304 = OpFunctionCall %void %out_int4_vi4 %i4
-%305 = OpLoad %v4int %i4
-%306 = OpVectorShuffle %v3int %305 %305 0 1 2
-OpStore %307 %306
-%308 = OpFunctionCall %void %out_int3_vi3 %307
-%309 = OpLoad %v3int %307
-%310 = OpLoad %v4int %i4
-%311 = OpVectorShuffle %v4int %310 %309 4 5 6 3
-OpStore %i4 %311
-%312 = OpAccessChain %_ptr_Function_int %i2 %int_1
-%313 = OpLoad %int %312
-OpStore %314 %313
-%315 = OpFunctionCall %void %out_int_vi %314
-%316 = OpLoad %int %314
-OpStore %312 %316
-%318 = OpFunctionCall %void %out_float_vf %f
-%320 = OpFunctionCall %void %out_float2_vf2 %f2
-%322 = OpFunctionCall %void %out_float3_vf3 %f3
-%324 = OpFunctionCall %void %out_float4_vf4 %f4
-%325 = OpLoad %v3float %f3
-%326 = OpVectorShuffle %v2float %325 %325 0 1
-OpStore %327 %326
-%328 = OpFunctionCall %void %out_float2_vf2 %327
-%329 = OpLoad %v2float %327
-%330 = OpLoad %v3float %f3
-%331 = OpVectorShuffle %v3float %330 %329 3 4 2
-OpStore %f3 %331
-%332 = OpAccessChain %_ptr_Function_float %f2 %int_0
-%333 = OpLoad %float %332
-OpStore %334 %333
-%335 = OpFunctionCall %void %out_float_vf %334
-%336 = OpLoad %float %334
-OpStore %332 %336
-%338 = OpFunctionCall %void %out_float2x2_vf22 %f2x2
-%340 = OpFunctionCall %void %out_float3x3_vf33 %f3x3
-%342 = OpFunctionCall %void %out_float4x4_vf44 %f4x4
-%343 = OpAccessChain %_ptr_Function_v2float %f2x2 %int_0
-%344 = OpAccessChain %_ptr_Function_float %343 %int_0
-%345 = OpLoad %float %344
-OpStore %346 %345
-%347 = OpFunctionCall %void %out_float_vf %346
-%348 = OpLoad %float %346
-OpStore %344 %348
-%350 = OpFunctionCall %void %out_bool_vb %b
-%352 = OpFunctionCall %void %out_bool2_vb2 %b2
-%354 = OpFunctionCall %void %out_bool3_vb3 %b3
-%356 = OpFunctionCall %void %out_bool4_vb4 %b4
-%357 = OpLoad %v4bool %b4
-%358 = OpVectorShuffle %v2bool %357 %357 0 3
-OpStore %359 %358
-%360 = OpFunctionCall %void %out_bool2_vb2 %359
-%361 = OpLoad %v2bool %359
-%362 = OpLoad %v4bool %b4
-%363 = OpVectorShuffle %v4bool %362 %361 4 1 2 5
-OpStore %b4 %363
-%364 = OpAccessChain %_ptr_Function_bool %b3 %int_2
-%365 = OpLoad %bool %364
-OpStore %366 %365
-%367 = OpFunctionCall %void %out_bool_vb %366
-%368 = OpLoad %bool %366
-OpStore %364 %368
+%266 = OpVectorShuffle %v4float %265 %264 6 7 4 5
+OpStore %h4 %266
+%268 = OpFunctionCall %void %out_half2x2_vh22 %h2x2
+%270 = OpFunctionCall %void %out_half3x3_vh33 %h3x3
+%272 = OpFunctionCall %void %out_half4x4_vh44 %h4x4
+%273 = OpAccessChain %_ptr_Function_v3float %h3x3 %int_1
+%275 = OpFunctionCall %void %out_half3_vh3 %274
+%276 = OpLoad %v3float %274
+OpStore %273 %276
+%278 = OpAccessChain %_ptr_Function_v4float %h4x4 %int_3
+%279 = OpAccessChain %_ptr_Function_float %278 %int_3
+%281 = OpFunctionCall %void %out_half_vh %280
+%282 = OpLoad %float %280
+OpStore %279 %282
+%284 = OpAccessChain %_ptr_Function_v2float %h2x2 %int_0
+%285 = OpAccessChain %_ptr_Function_float %284 %int_0
+%287 = OpFunctionCall %void %out_half_vh %286
+%288 = OpLoad %float %286
+OpStore %285 %288
+%290 = OpFunctionCall %void %out_int_vi %i
+%292 = OpFunctionCall %void %out_int2_vi2 %i2
+%294 = OpFunctionCall %void %out_int3_vi3 %i3
+%296 = OpFunctionCall %void %out_int4_vi4 %i4
+%298 = OpFunctionCall %void %out_int3_vi3 %297
+%299 = OpLoad %v3int %297
+%300 = OpLoad %v4int %i4
+%301 = OpVectorShuffle %v4int %300 %299 4 5 6 3
+OpStore %i4 %301
+%302 = OpAccessChain %_ptr_Function_int %i2 %int_1
+%304 = OpFunctionCall %void %out_int_vi %303
+%305 = OpLoad %int %303
+OpStore %302 %305
+%307 = OpFunctionCall %void %out_float_vf %f
+%309 = OpFunctionCall %void %out_float2_vf2 %f2
+%311 = OpFunctionCall %void %out_float3_vf3 %f3
+%313 = OpFunctionCall %void %out_float4_vf4 %f4
+%315 = OpFunctionCall %void %out_float2_vf2 %314
+%316 = OpLoad %v2float %314
+%317 = OpLoad %v3float %f3
+%318 = OpVectorShuffle %v3float %317 %316 3 4 2
+OpStore %f3 %318
+%319 = OpAccessChain %_ptr_Function_float %f2 %int_0
+%321 = OpFunctionCall %void %out_float_vf %320
+%322 = OpLoad %float %320
+OpStore %319 %322
+%324 = OpFunctionCall %void %out_float2x2_vf22 %f2x2
+%326 = OpFunctionCall %void %out_float3x3_vf33 %f3x3
+%328 = OpFunctionCall %void %out_float4x4_vf44 %f4x4
+%329 = OpAccessChain %_ptr_Function_v2float %f2x2 %int_0
+%330 = OpAccessChain %_ptr_Function_float %329 %int_0
+%332 = OpFunctionCall %void %out_float_vf %331
+%333 = OpLoad %float %331
+OpStore %330 %333
+%335 = OpFunctionCall %void %out_bool_vb %b
+%337 = OpFunctionCall %void %out_bool2_vb2 %b2
+%339 = OpFunctionCall %void %out_bool3_vb3 %b3
+%341 = OpFunctionCall %void %out_bool4_vb4 %b4
+%343 = OpFunctionCall %void %out_bool2_vb2 %342
+%344 = OpLoad %v2bool %342
+%345 = OpLoad %v4bool %b4
+%346 = OpVectorShuffle %v4bool %345 %344 4 1 2 5
+OpStore %b4 %346
+%347 = OpAccessChain %_ptr_Function_bool %b3 %int_2
+%349 = OpFunctionCall %void %out_bool_vb %348
+%350 = OpLoad %bool %348
+OpStore %347 %350
 OpStore %ok %true
-%372 = OpLoad %bool %ok
-OpSelectionMerge %374 None
-OpBranchConditional %372 %373 %374
-%373 = OpLabel
-%376 = OpLoad %float %h
-%377 = OpLoad %v2float %h2
+%354 = OpLoad %bool %ok
+OpSelectionMerge %356 None
+OpBranchConditional %354 %355 %356
+%355 = OpLabel
+%358 = OpLoad %float %h
+%359 = OpLoad %v2float %h2
+%360 = OpCompositeExtract %float %359 0
+%361 = OpFMul %float %358 %360
+%362 = OpLoad %v3float %h3
+%363 = OpCompositeExtract %float %362 0
+%364 = OpFMul %float %361 %363
+%365 = OpLoad %v4float %h4
+%366 = OpCompositeExtract %float %365 0
+%367 = OpFMul %float %364 %366
+%368 = OpAccessChain %_ptr_Function_v2float %h2x2 %int_0
+%369 = OpLoad %v2float %368
+%370 = OpCompositeExtract %float %369 0
+%371 = OpFMul %float %367 %370
+%372 = OpAccessChain %_ptr_Function_v3float %h3x3 %int_0
+%373 = OpLoad %v3float %372
+%374 = OpCompositeExtract %float %373 0
+%375 = OpFMul %float %371 %374
+%376 = OpAccessChain %_ptr_Function_v4float %h4x4 %int_0
+%377 = OpLoad %v4float %376
 %378 = OpCompositeExtract %float %377 0
-%379 = OpFMul %float %376 %378
-%380 = OpLoad %v3float %h3
-%381 = OpCompositeExtract %float %380 0
-%382 = OpFMul %float %379 %381
-%383 = OpLoad %v4float %h4
-%384 = OpCompositeExtract %float %383 0
-%385 = OpFMul %float %382 %384
-%386 = OpAccessChain %_ptr_Function_v2float %h2x2 %int_0
-%387 = OpLoad %v2float %386
-%388 = OpCompositeExtract %float %387 0
-%389 = OpFMul %float %385 %388
-%390 = OpAccessChain %_ptr_Function_v3float %h3x3 %int_0
-%391 = OpLoad %v3float %390
-%392 = OpCompositeExtract %float %391 0
-%393 = OpFMul %float %389 %392
-%394 = OpAccessChain %_ptr_Function_v4float %h4x4 %int_0
-%395 = OpLoad %v4float %394
-%396 = OpCompositeExtract %float %395 0
-%397 = OpFMul %float %393 %396
-%398 = OpFOrdEqual %bool %float_1 %397
-OpBranch %374
-%374 = OpLabel
-%399 = OpPhi %bool %false %243 %398 %373
-OpStore %ok %399
-%400 = OpLoad %bool %ok
-OpSelectionMerge %402 None
-OpBranchConditional %400 %401 %402
-%401 = OpLabel
-%403 = OpLoad %float %f
-%404 = OpLoad %v2float %f2
+%379 = OpFMul %float %375 %378
+%380 = OpFOrdEqual %bool %float_1 %379
+OpBranch %356
+%356 = OpLabel
+%381 = OpPhi %bool %false %243 %380 %355
+OpStore %ok %381
+%382 = OpLoad %bool %ok
+OpSelectionMerge %384 None
+OpBranchConditional %382 %383 %384
+%383 = OpLabel
+%385 = OpLoad %float %f
+%386 = OpLoad %v2float %f2
+%387 = OpCompositeExtract %float %386 0
+%388 = OpFMul %float %385 %387
+%389 = OpLoad %v3float %f3
+%390 = OpCompositeExtract %float %389 0
+%391 = OpFMul %float %388 %390
+%392 = OpLoad %v4float %f4
+%393 = OpCompositeExtract %float %392 0
+%394 = OpFMul %float %391 %393
+%395 = OpAccessChain %_ptr_Function_v2float %f2x2 %int_0
+%396 = OpLoad %v2float %395
+%397 = OpCompositeExtract %float %396 0
+%398 = OpFMul %float %394 %397
+%399 = OpAccessChain %_ptr_Function_v3float %f3x3 %int_0
+%400 = OpLoad %v3float %399
+%401 = OpCompositeExtract %float %400 0
+%402 = OpFMul %float %398 %401
+%403 = OpAccessChain %_ptr_Function_v4float %f4x4 %int_0
+%404 = OpLoad %v4float %403
 %405 = OpCompositeExtract %float %404 0
-%406 = OpFMul %float %403 %405
-%407 = OpLoad %v3float %f3
-%408 = OpCompositeExtract %float %407 0
-%409 = OpFMul %float %406 %408
-%410 = OpLoad %v4float %f4
-%411 = OpCompositeExtract %float %410 0
-%412 = OpFMul %float %409 %411
-%413 = OpAccessChain %_ptr_Function_v2float %f2x2 %int_0
-%414 = OpLoad %v2float %413
-%415 = OpCompositeExtract %float %414 0
-%416 = OpFMul %float %412 %415
-%417 = OpAccessChain %_ptr_Function_v3float %f3x3 %int_0
-%418 = OpLoad %v3float %417
-%419 = OpCompositeExtract %float %418 0
-%420 = OpFMul %float %416 %419
-%421 = OpAccessChain %_ptr_Function_v4float %f4x4 %int_0
-%422 = OpLoad %v4float %421
-%423 = OpCompositeExtract %float %422 0
-%424 = OpFMul %float %420 %423
-%425 = OpFOrdEqual %bool %float_1 %424
-OpBranch %402
-%402 = OpLabel
-%426 = OpPhi %bool %false %374 %425 %401
-OpStore %ok %426
-%427 = OpLoad %bool %ok
+%406 = OpFMul %float %402 %405
+%407 = OpFOrdEqual %bool %float_1 %406
+OpBranch %384
+%384 = OpLabel
+%408 = OpPhi %bool %false %356 %407 %383
+OpStore %ok %408
+%409 = OpLoad %bool %ok
+OpSelectionMerge %411 None
+OpBranchConditional %409 %410 %411
+%410 = OpLabel
+%412 = OpLoad %int %i
+%413 = OpLoad %v2int %i2
+%414 = OpCompositeExtract %int %413 0
+%415 = OpIMul %int %412 %414
+%416 = OpLoad %v3int %i3
+%417 = OpCompositeExtract %int %416 0
+%418 = OpIMul %int %415 %417
+%419 = OpLoad %v4int %i4
+%420 = OpCompositeExtract %int %419 0
+%421 = OpIMul %int %418 %420
+%422 = OpIEqual %bool %int_1 %421
+OpBranch %411
+%411 = OpLabel
+%423 = OpPhi %bool %false %384 %422 %410
+OpStore %ok %423
+%424 = OpLoad %bool %ok
+OpSelectionMerge %426 None
+OpBranchConditional %424 %425 %426
+%425 = OpLabel
+%427 = OpLoad %bool %b
 OpSelectionMerge %429 None
 OpBranchConditional %427 %428 %429
 %428 = OpLabel
-%430 = OpLoad %int %i
-%431 = OpLoad %v2int %i2
-%432 = OpCompositeExtract %int %431 0
-%433 = OpIMul %int %430 %432
-%434 = OpLoad %v3int %i3
-%435 = OpCompositeExtract %int %434 0
-%436 = OpIMul %int %433 %435
-%437 = OpLoad %v4int %i4
-%438 = OpCompositeExtract %int %437 0
-%439 = OpIMul %int %436 %438
-%440 = OpIEqual %bool %int_1 %439
+%430 = OpLoad %v2bool %b2
+%431 = OpCompositeExtract %bool %430 0
 OpBranch %429
 %429 = OpLabel
-%441 = OpPhi %bool %false %402 %440 %428
-OpStore %ok %441
-%442 = OpLoad %bool %ok
-OpSelectionMerge %444 None
-OpBranchConditional %442 %443 %444
-%443 = OpLabel
-%445 = OpLoad %bool %b
-OpSelectionMerge %447 None
-OpBranchConditional %445 %446 %447
+%432 = OpPhi %bool %false %425 %431 %428
+OpSelectionMerge %434 None
+OpBranchConditional %432 %433 %434
+%433 = OpLabel
+%435 = OpLoad %v3bool %b3
+%436 = OpCompositeExtract %bool %435 0
+OpBranch %434
+%434 = OpLabel
+%437 = OpPhi %bool %false %429 %436 %433
+OpSelectionMerge %439 None
+OpBranchConditional %437 %438 %439
+%438 = OpLabel
+%440 = OpLoad %v4bool %b4
+%441 = OpCompositeExtract %bool %440 0
+OpBranch %439
+%439 = OpLabel
+%442 = OpPhi %bool %false %434 %441 %438
+OpBranch %426
+%426 = OpLabel
+%443 = OpPhi %bool %false %411 %442 %439
+OpStore %ok %443
+%444 = OpLoad %bool %ok
+OpSelectionMerge %448 None
+OpBranchConditional %444 %446 %447
 %446 = OpLabel
-%448 = OpLoad %v2bool %b2
-%449 = OpCompositeExtract %bool %448 0
-OpBranch %447
+%449 = OpAccessChain %_ptr_Uniform_v4float %32 %int_0
+%450 = OpLoad %v4float %449
+OpStore %445 %450
+OpBranch %448
 %447 = OpLabel
-%450 = OpPhi %bool %false %443 %449 %446
-OpSelectionMerge %452 None
-OpBranchConditional %450 %451 %452
-%451 = OpLabel
-%453 = OpLoad %v3bool %b3
-%454 = OpCompositeExtract %bool %453 0
-OpBranch %452
-%452 = OpLabel
-%455 = OpPhi %bool %false %447 %454 %451
-OpSelectionMerge %457 None
-OpBranchConditional %455 %456 %457
-%456 = OpLabel
-%458 = OpLoad %v4bool %b4
-%459 = OpCompositeExtract %bool %458 0
-OpBranch %457
-%457 = OpLabel
-%460 = OpPhi %bool %false %452 %459 %456
-OpBranch %444
-%444 = OpLabel
-%461 = OpPhi %bool %false %429 %460 %457
-OpStore %ok %461
-%462 = OpLoad %bool %ok
-OpSelectionMerge %466 None
-OpBranchConditional %462 %464 %465
-%464 = OpLabel
-%467 = OpAccessChain %_ptr_Uniform_v4float %32 %int_0
-%468 = OpLoad %v4float %467
-OpStore %463 %468
-OpBranch %466
-%465 = OpLabel
-%469 = OpAccessChain %_ptr_Uniform_v4float %32 %int_1
-%470 = OpLoad %v4float %469
-OpStore %463 %470
-OpBranch %466
-%466 = OpLabel
-%471 = OpLoad %v4float %463
-OpReturnValue %471
+%451 = OpAccessChain %_ptr_Uniform_v4float %32 %int_1
+%452 = OpLoad %v4float %451
+OpStore %445 %452
+OpBranch %448
+%448 = OpLabel
+%453 = OpLoad %v4float %445
+OpReturnValue %453
 OpFunctionEnd
diff --git a/tests/sksl/shared/OutParamsNoInline.asm.frag b/tests/sksl/shared/OutParamsNoInline.asm.frag
index 9725234..5621226 100644
--- a/tests/sksl/shared/OutParamsNoInline.asm.frag
+++ b/tests/sksl/shared/OutParamsNoInline.asm.frag
@@ -133,64 +133,55 @@
 OpDecorate %h3 RelaxedPrecision
 OpDecorate %h4 RelaxedPrecision
 OpDecorate %254 RelaxedPrecision
-OpDecorate %255 RelaxedPrecision
+OpDecorate %256 RelaxedPrecision
 OpDecorate %257 RelaxedPrecision
-OpDecorate %258 RelaxedPrecision
 OpDecorate %259 RelaxedPrecision
 OpDecorate %260 RelaxedPrecision
+OpDecorate %261 RelaxedPrecision
 OpDecorate %262 RelaxedPrecision
-OpDecorate %263 RelaxedPrecision
 OpDecorate %264 RelaxedPrecision
 OpDecorate %265 RelaxedPrecision
 OpDecorate %266 RelaxedPrecision
-OpDecorate %267 RelaxedPrecision
-OpDecorate %269 RelaxedPrecision
-OpDecorate %270 RelaxedPrecision
-OpDecorate %271 RelaxedPrecision
 OpDecorate %h2x2 RelaxedPrecision
 OpDecorate %h3x3 RelaxedPrecision
 OpDecorate %h4x4 RelaxedPrecision
-OpDecorate %279 RelaxedPrecision
+OpDecorate %274 RelaxedPrecision
+OpDecorate %276 RelaxedPrecision
 OpDecorate %280 RelaxedPrecision
 OpDecorate %282 RelaxedPrecision
 OpDecorate %286 RelaxedPrecision
-OpDecorate %287 RelaxedPrecision
-OpDecorate %289 RelaxedPrecision
-OpDecorate %293 RelaxedPrecision
-OpDecorate %294 RelaxedPrecision
-OpDecorate %296 RelaxedPrecision
+OpDecorate %288 RelaxedPrecision
+OpDecorate %354 RelaxedPrecision
+OpDecorate %358 RelaxedPrecision
+OpDecorate %359 RelaxedPrecision
+OpDecorate %360 RelaxedPrecision
+OpDecorate %361 RelaxedPrecision
+OpDecorate %362 RelaxedPrecision
+OpDecorate %363 RelaxedPrecision
+OpDecorate %364 RelaxedPrecision
 OpDecorate %365 RelaxedPrecision
-OpDecorate %372 RelaxedPrecision
-OpDecorate %376 RelaxedPrecision
+OpDecorate %366 RelaxedPrecision
+OpDecorate %367 RelaxedPrecision
+OpDecorate %369 RelaxedPrecision
+OpDecorate %370 RelaxedPrecision
+OpDecorate %371 RelaxedPrecision
+OpDecorate %373 RelaxedPrecision
+OpDecorate %374 RelaxedPrecision
+OpDecorate %375 RelaxedPrecision
 OpDecorate %377 RelaxedPrecision
 OpDecorate %378 RelaxedPrecision
 OpDecorate %379 RelaxedPrecision
-OpDecorate %380 RelaxedPrecision
-OpDecorate %381 RelaxedPrecision
 OpDecorate %382 RelaxedPrecision
-OpDecorate %383 RelaxedPrecision
-OpDecorate %384 RelaxedPrecision
-OpDecorate %385 RelaxedPrecision
-OpDecorate %387 RelaxedPrecision
-OpDecorate %388 RelaxedPrecision
-OpDecorate %389 RelaxedPrecision
-OpDecorate %391 RelaxedPrecision
-OpDecorate %392 RelaxedPrecision
-OpDecorate %393 RelaxedPrecision
-OpDecorate %395 RelaxedPrecision
-OpDecorate %396 RelaxedPrecision
-OpDecorate %397 RelaxedPrecision
-OpDecorate %400 RelaxedPrecision
+OpDecorate %409 RelaxedPrecision
+OpDecorate %424 RelaxedPrecision
 OpDecorate %427 RelaxedPrecision
-OpDecorate %442 RelaxedPrecision
-OpDecorate %445 RelaxedPrecision
-OpDecorate %448 RelaxedPrecision
+OpDecorate %430 RelaxedPrecision
+OpDecorate %435 RelaxedPrecision
+OpDecorate %440 RelaxedPrecision
+OpDecorate %444 RelaxedPrecision
+OpDecorate %450 RelaxedPrecision
+OpDecorate %452 RelaxedPrecision
 OpDecorate %453 RelaxedPrecision
-OpDecorate %458 RelaxedPrecision
-OpDecorate %462 RelaxedPrecision
-OpDecorate %468 RelaxedPrecision
-OpDecorate %470 RelaxedPrecision
-OpDecorate %471 RelaxedPrecision
 %float = OpTypeFloat 32
 %v4float = OpTypeVector %float 4
 %_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -513,281 +504,250 @@
 %h2 = OpVariable %_ptr_Function_v2float Function
 %h3 = OpVariable %_ptr_Function_v3float Function
 %h4 = OpVariable %_ptr_Function_v4float Function
-%255 = OpVariable %_ptr_Function_float Function
-%260 = OpVariable %_ptr_Function_v2float Function
-%267 = OpVariable %_ptr_Function_v4float Function
+%254 = OpVariable %_ptr_Function_float Function
+%257 = OpVariable %_ptr_Function_v2float Function
+%262 = OpVariable %_ptr_Function_v4float Function
 %h2x2 = OpVariable %_ptr_Function_mat2v2float Function
 %h3x3 = OpVariable %_ptr_Function_mat3v3float Function
 %h4x4 = OpVariable %_ptr_Function_mat4v4float Function
-%280 = OpVariable %_ptr_Function_v3float Function
-%287 = OpVariable %_ptr_Function_float Function
-%294 = OpVariable %_ptr_Function_float Function
+%274 = OpVariable %_ptr_Function_v3float Function
+%280 = OpVariable %_ptr_Function_float Function
+%286 = OpVariable %_ptr_Function_float Function
 %i = OpVariable %_ptr_Function_int Function
 %i2 = OpVariable %_ptr_Function_v2int Function
 %i3 = OpVariable %_ptr_Function_v3int Function
 %i4 = OpVariable %_ptr_Function_v4int Function
-%307 = OpVariable %_ptr_Function_v3int Function
-%314 = OpVariable %_ptr_Function_int Function
+%297 = OpVariable %_ptr_Function_v3int Function
+%303 = OpVariable %_ptr_Function_int Function
 %f = OpVariable %_ptr_Function_float Function
 %f2 = OpVariable %_ptr_Function_v2float Function
 %f3 = OpVariable %_ptr_Function_v3float Function
 %f4 = OpVariable %_ptr_Function_v4float Function
-%327 = OpVariable %_ptr_Function_v2float Function
-%334 = OpVariable %_ptr_Function_float Function
+%314 = OpVariable %_ptr_Function_v2float Function
+%320 = OpVariable %_ptr_Function_float Function
 %f2x2 = OpVariable %_ptr_Function_mat2v2float Function
 %f3x3 = OpVariable %_ptr_Function_mat3v3float Function
 %f4x4 = OpVariable %_ptr_Function_mat4v4float Function
-%346 = OpVariable %_ptr_Function_float Function
+%331 = OpVariable %_ptr_Function_float Function
 %b = OpVariable %_ptr_Function_bool Function
 %b2 = OpVariable %_ptr_Function_v2bool Function
 %b3 = OpVariable %_ptr_Function_v3bool Function
 %b4 = OpVariable %_ptr_Function_v4bool Function
-%359 = OpVariable %_ptr_Function_v2bool Function
-%366 = OpVariable %_ptr_Function_bool Function
+%342 = OpVariable %_ptr_Function_v2bool Function
+%348 = OpVariable %_ptr_Function_bool Function
 %ok = OpVariable %_ptr_Function_bool Function
-%463 = OpVariable %_ptr_Function_v4float Function
+%445 = OpVariable %_ptr_Function_v4float Function
 %245 = OpFunctionCall %void %out_half_vh %h
 %247 = OpFunctionCall %void %out_half2_vh2 %h2
 %249 = OpFunctionCall %void %out_half3_vh3 %h3
 %251 = OpFunctionCall %void %out_half4_vh4 %h4
 %252 = OpAccessChain %_ptr_Function_float %h3 %int_1
-%254 = OpLoad %float %252
-OpStore %255 %254
-%256 = OpFunctionCall %void %out_half_vh %255
-%257 = OpLoad %float %255
-OpStore %252 %257
-%258 = OpLoad %v3float %h3
-%259 = OpVectorShuffle %v2float %258 %258 0 2
-OpStore %260 %259
-%261 = OpFunctionCall %void %out_half2_vh2 %260
-%262 = OpLoad %v2float %260
-%263 = OpLoad %v3float %h3
-%264 = OpVectorShuffle %v3float %263 %262 3 1 4
-OpStore %h3 %264
+%255 = OpFunctionCall %void %out_half_vh %254
+%256 = OpLoad %float %254
+OpStore %252 %256
+%258 = OpFunctionCall %void %out_half2_vh2 %257
+%259 = OpLoad %v2float %257
+%260 = OpLoad %v3float %h3
+%261 = OpVectorShuffle %v3float %260 %259 3 1 4
+OpStore %h3 %261
+%263 = OpFunctionCall %void %out_half4_vh4 %262
+%264 = OpLoad %v4float %262
 %265 = OpLoad %v4float %h4
-%266 = OpVectorShuffle %v4float %265 %265 2 3 0 1
-OpStore %267 %266
-%268 = OpFunctionCall %void %out_half4_vh4 %267
-%269 = OpLoad %v4float %267
-%270 = OpLoad %v4float %h4
-%271 = OpVectorShuffle %v4float %270 %269 6 7 4 5
-OpStore %h4 %271
-%273 = OpFunctionCall %void %out_half2x2_vh22 %h2x2
-%275 = OpFunctionCall %void %out_half3x3_vh33 %h3x3
-%277 = OpFunctionCall %void %out_half4x4_vh44 %h4x4
-%278 = OpAccessChain %_ptr_Function_v3float %h3x3 %int_1
-%279 = OpLoad %v3float %278
-OpStore %280 %279
-%281 = OpFunctionCall %void %out_half3_vh3 %280
-%282 = OpLoad %v3float %280
-OpStore %278 %282
-%284 = OpAccessChain %_ptr_Function_v4float %h4x4 %int_3
-%285 = OpAccessChain %_ptr_Function_float %284 %int_3
-%286 = OpLoad %float %285
-OpStore %287 %286
-%288 = OpFunctionCall %void %out_half_vh %287
-%289 = OpLoad %float %287
-OpStore %285 %289
-%291 = OpAccessChain %_ptr_Function_v2float %h2x2 %int_0
-%292 = OpAccessChain %_ptr_Function_float %291 %int_0
-%293 = OpLoad %float %292
-OpStore %294 %293
-%295 = OpFunctionCall %void %out_half_vh %294
-%296 = OpLoad %float %294
-OpStore %292 %296
-%298 = OpFunctionCall %void %out_int_vi %i
-%300 = OpFunctionCall %void %out_int2_vi2 %i2
-%302 = OpFunctionCall %void %out_int3_vi3 %i3
-%304 = OpFunctionCall %void %out_int4_vi4 %i4
-%305 = OpLoad %v4int %i4
-%306 = OpVectorShuffle %v3int %305 %305 0 1 2
-OpStore %307 %306
-%308 = OpFunctionCall %void %out_int3_vi3 %307
-%309 = OpLoad %v3int %307
-%310 = OpLoad %v4int %i4
-%311 = OpVectorShuffle %v4int %310 %309 4 5 6 3
-OpStore %i4 %311
-%312 = OpAccessChain %_ptr_Function_int %i2 %int_1
-%313 = OpLoad %int %312
-OpStore %314 %313
-%315 = OpFunctionCall %void %out_int_vi %314
-%316 = OpLoad %int %314
-OpStore %312 %316
-%318 = OpFunctionCall %void %out_float_vf %f
-%320 = OpFunctionCall %void %out_float2_vf2 %f2
-%322 = OpFunctionCall %void %out_float3_vf3 %f3
-%324 = OpFunctionCall %void %out_float4_vf4 %f4
-%325 = OpLoad %v3float %f3
-%326 = OpVectorShuffle %v2float %325 %325 0 1
-OpStore %327 %326
-%328 = OpFunctionCall %void %out_float2_vf2 %327
-%329 = OpLoad %v2float %327
-%330 = OpLoad %v3float %f3
-%331 = OpVectorShuffle %v3float %330 %329 3 4 2
-OpStore %f3 %331
-%332 = OpAccessChain %_ptr_Function_float %f2 %int_0
-%333 = OpLoad %float %332
-OpStore %334 %333
-%335 = OpFunctionCall %void %out_float_vf %334
-%336 = OpLoad %float %334
-OpStore %332 %336
-%338 = OpFunctionCall %void %out_float2x2_vf22 %f2x2
-%340 = OpFunctionCall %void %out_float3x3_vf33 %f3x3
-%342 = OpFunctionCall %void %out_float4x4_vf44 %f4x4
-%343 = OpAccessChain %_ptr_Function_v2float %f2x2 %int_0
-%344 = OpAccessChain %_ptr_Function_float %343 %int_0
-%345 = OpLoad %float %344
-OpStore %346 %345
-%347 = OpFunctionCall %void %out_float_vf %346
-%348 = OpLoad %float %346
-OpStore %344 %348
-%350 = OpFunctionCall %void %out_bool_vb %b
-%352 = OpFunctionCall %void %out_bool2_vb2 %b2
-%354 = OpFunctionCall %void %out_bool3_vb3 %b3
-%356 = OpFunctionCall %void %out_bool4_vb4 %b4
-%357 = OpLoad %v4bool %b4
-%358 = OpVectorShuffle %v2bool %357 %357 0 3
-OpStore %359 %358
-%360 = OpFunctionCall %void %out_bool2_vb2 %359
-%361 = OpLoad %v2bool %359
-%362 = OpLoad %v4bool %b4
-%363 = OpVectorShuffle %v4bool %362 %361 4 1 2 5
-OpStore %b4 %363
-%364 = OpAccessChain %_ptr_Function_bool %b3 %int_2
-%365 = OpLoad %bool %364
-OpStore %366 %365
-%367 = OpFunctionCall %void %out_bool_vb %366
-%368 = OpLoad %bool %366
-OpStore %364 %368
+%266 = OpVectorShuffle %v4float %265 %264 6 7 4 5
+OpStore %h4 %266
+%268 = OpFunctionCall %void %out_half2x2_vh22 %h2x2
+%270 = OpFunctionCall %void %out_half3x3_vh33 %h3x3
+%272 = OpFunctionCall %void %out_half4x4_vh44 %h4x4
+%273 = OpAccessChain %_ptr_Function_v3float %h3x3 %int_1
+%275 = OpFunctionCall %void %out_half3_vh3 %274
+%276 = OpLoad %v3float %274
+OpStore %273 %276
+%278 = OpAccessChain %_ptr_Function_v4float %h4x4 %int_3
+%279 = OpAccessChain %_ptr_Function_float %278 %int_3
+%281 = OpFunctionCall %void %out_half_vh %280
+%282 = OpLoad %float %280
+OpStore %279 %282
+%284 = OpAccessChain %_ptr_Function_v2float %h2x2 %int_0
+%285 = OpAccessChain %_ptr_Function_float %284 %int_0
+%287 = OpFunctionCall %void %out_half_vh %286
+%288 = OpLoad %float %286
+OpStore %285 %288
+%290 = OpFunctionCall %void %out_int_vi %i
+%292 = OpFunctionCall %void %out_int2_vi2 %i2
+%294 = OpFunctionCall %void %out_int3_vi3 %i3
+%296 = OpFunctionCall %void %out_int4_vi4 %i4
+%298 = OpFunctionCall %void %out_int3_vi3 %297
+%299 = OpLoad %v3int %297
+%300 = OpLoad %v4int %i4
+%301 = OpVectorShuffle %v4int %300 %299 4 5 6 3
+OpStore %i4 %301
+%302 = OpAccessChain %_ptr_Function_int %i2 %int_1
+%304 = OpFunctionCall %void %out_int_vi %303
+%305 = OpLoad %int %303
+OpStore %302 %305
+%307 = OpFunctionCall %void %out_float_vf %f
+%309 = OpFunctionCall %void %out_float2_vf2 %f2
+%311 = OpFunctionCall %void %out_float3_vf3 %f3
+%313 = OpFunctionCall %void %out_float4_vf4 %f4
+%315 = OpFunctionCall %void %out_float2_vf2 %314
+%316 = OpLoad %v2float %314
+%317 = OpLoad %v3float %f3
+%318 = OpVectorShuffle %v3float %317 %316 3 4 2
+OpStore %f3 %318
+%319 = OpAccessChain %_ptr_Function_float %f2 %int_0
+%321 = OpFunctionCall %void %out_float_vf %320
+%322 = OpLoad %float %320
+OpStore %319 %322
+%324 = OpFunctionCall %void %out_float2x2_vf22 %f2x2
+%326 = OpFunctionCall %void %out_float3x3_vf33 %f3x3
+%328 = OpFunctionCall %void %out_float4x4_vf44 %f4x4
+%329 = OpAccessChain %_ptr_Function_v2float %f2x2 %int_0
+%330 = OpAccessChain %_ptr_Function_float %329 %int_0
+%332 = OpFunctionCall %void %out_float_vf %331
+%333 = OpLoad %float %331
+OpStore %330 %333
+%335 = OpFunctionCall %void %out_bool_vb %b
+%337 = OpFunctionCall %void %out_bool2_vb2 %b2
+%339 = OpFunctionCall %void %out_bool3_vb3 %b3
+%341 = OpFunctionCall %void %out_bool4_vb4 %b4
+%343 = OpFunctionCall %void %out_bool2_vb2 %342
+%344 = OpLoad %v2bool %342
+%345 = OpLoad %v4bool %b4
+%346 = OpVectorShuffle %v4bool %345 %344 4 1 2 5
+OpStore %b4 %346
+%347 = OpAccessChain %_ptr_Function_bool %b3 %int_2
+%349 = OpFunctionCall %void %out_bool_vb %348
+%350 = OpLoad %bool %348
+OpStore %347 %350
 OpStore %ok %true
-%372 = OpLoad %bool %ok
-OpSelectionMerge %374 None
-OpBranchConditional %372 %373 %374
-%373 = OpLabel
-%376 = OpLoad %float %h
-%377 = OpLoad %v2float %h2
+%354 = OpLoad %bool %ok
+OpSelectionMerge %356 None
+OpBranchConditional %354 %355 %356
+%355 = OpLabel
+%358 = OpLoad %float %h
+%359 = OpLoad %v2float %h2
+%360 = OpCompositeExtract %float %359 0
+%361 = OpFMul %float %358 %360
+%362 = OpLoad %v3float %h3
+%363 = OpCompositeExtract %float %362 0
+%364 = OpFMul %float %361 %363
+%365 = OpLoad %v4float %h4
+%366 = OpCompositeExtract %float %365 0
+%367 = OpFMul %float %364 %366
+%368 = OpAccessChain %_ptr_Function_v2float %h2x2 %int_0
+%369 = OpLoad %v2float %368
+%370 = OpCompositeExtract %float %369 0
+%371 = OpFMul %float %367 %370
+%372 = OpAccessChain %_ptr_Function_v3float %h3x3 %int_0
+%373 = OpLoad %v3float %372
+%374 = OpCompositeExtract %float %373 0
+%375 = OpFMul %float %371 %374
+%376 = OpAccessChain %_ptr_Function_v4float %h4x4 %int_0
+%377 = OpLoad %v4float %376
 %378 = OpCompositeExtract %float %377 0
-%379 = OpFMul %float %376 %378
-%380 = OpLoad %v3float %h3
-%381 = OpCompositeExtract %float %380 0
-%382 = OpFMul %float %379 %381
-%383 = OpLoad %v4float %h4
-%384 = OpCompositeExtract %float %383 0
-%385 = OpFMul %float %382 %384
-%386 = OpAccessChain %_ptr_Function_v2float %h2x2 %int_0
-%387 = OpLoad %v2float %386
-%388 = OpCompositeExtract %float %387 0
-%389 = OpFMul %float %385 %388
-%390 = OpAccessChain %_ptr_Function_v3float %h3x3 %int_0
-%391 = OpLoad %v3float %390
-%392 = OpCompositeExtract %float %391 0
-%393 = OpFMul %float %389 %392
-%394 = OpAccessChain %_ptr_Function_v4float %h4x4 %int_0
-%395 = OpLoad %v4float %394
-%396 = OpCompositeExtract %float %395 0
-%397 = OpFMul %float %393 %396
-%398 = OpFOrdEqual %bool %float_1 %397
-OpBranch %374
-%374 = OpLabel
-%399 = OpPhi %bool %false %243 %398 %373
-OpStore %ok %399
-%400 = OpLoad %bool %ok
-OpSelectionMerge %402 None
-OpBranchConditional %400 %401 %402
-%401 = OpLabel
-%403 = OpLoad %float %f
-%404 = OpLoad %v2float %f2
+%379 = OpFMul %float %375 %378
+%380 = OpFOrdEqual %bool %float_1 %379
+OpBranch %356
+%356 = OpLabel
+%381 = OpPhi %bool %false %243 %380 %355
+OpStore %ok %381
+%382 = OpLoad %bool %ok
+OpSelectionMerge %384 None
+OpBranchConditional %382 %383 %384
+%383 = OpLabel
+%385 = OpLoad %float %f
+%386 = OpLoad %v2float %f2
+%387 = OpCompositeExtract %float %386 0
+%388 = OpFMul %float %385 %387
+%389 = OpLoad %v3float %f3
+%390 = OpCompositeExtract %float %389 0
+%391 = OpFMul %float %388 %390
+%392 = OpLoad %v4float %f4
+%393 = OpCompositeExtract %float %392 0
+%394 = OpFMul %float %391 %393
+%395 = OpAccessChain %_ptr_Function_v2float %f2x2 %int_0
+%396 = OpLoad %v2float %395
+%397 = OpCompositeExtract %float %396 0
+%398 = OpFMul %float %394 %397
+%399 = OpAccessChain %_ptr_Function_v3float %f3x3 %int_0
+%400 = OpLoad %v3float %399
+%401 = OpCompositeExtract %float %400 0
+%402 = OpFMul %float %398 %401
+%403 = OpAccessChain %_ptr_Function_v4float %f4x4 %int_0
+%404 = OpLoad %v4float %403
 %405 = OpCompositeExtract %float %404 0
-%406 = OpFMul %float %403 %405
-%407 = OpLoad %v3float %f3
-%408 = OpCompositeExtract %float %407 0
-%409 = OpFMul %float %406 %408
-%410 = OpLoad %v4float %f4
-%411 = OpCompositeExtract %float %410 0
-%412 = OpFMul %float %409 %411
-%413 = OpAccessChain %_ptr_Function_v2float %f2x2 %int_0
-%414 = OpLoad %v2float %413
-%415 = OpCompositeExtract %float %414 0
-%416 = OpFMul %float %412 %415
-%417 = OpAccessChain %_ptr_Function_v3float %f3x3 %int_0
-%418 = OpLoad %v3float %417
-%419 = OpCompositeExtract %float %418 0
-%420 = OpFMul %float %416 %419
-%421 = OpAccessChain %_ptr_Function_v4float %f4x4 %int_0
-%422 = OpLoad %v4float %421
-%423 = OpCompositeExtract %float %422 0
-%424 = OpFMul %float %420 %423
-%425 = OpFOrdEqual %bool %float_1 %424
-OpBranch %402
-%402 = OpLabel
-%426 = OpPhi %bool %false %374 %425 %401
-OpStore %ok %426
-%427 = OpLoad %bool %ok
+%406 = OpFMul %float %402 %405
+%407 = OpFOrdEqual %bool %float_1 %406
+OpBranch %384
+%384 = OpLabel
+%408 = OpPhi %bool %false %356 %407 %383
+OpStore %ok %408
+%409 = OpLoad %bool %ok
+OpSelectionMerge %411 None
+OpBranchConditional %409 %410 %411
+%410 = OpLabel
+%412 = OpLoad %int %i
+%413 = OpLoad %v2int %i2
+%414 = OpCompositeExtract %int %413 0
+%415 = OpIMul %int %412 %414
+%416 = OpLoad %v3int %i3
+%417 = OpCompositeExtract %int %416 0
+%418 = OpIMul %int %415 %417
+%419 = OpLoad %v4int %i4
+%420 = OpCompositeExtract %int %419 0
+%421 = OpIMul %int %418 %420
+%422 = OpIEqual %bool %int_1 %421
+OpBranch %411
+%411 = OpLabel
+%423 = OpPhi %bool %false %384 %422 %410
+OpStore %ok %423
+%424 = OpLoad %bool %ok
+OpSelectionMerge %426 None
+OpBranchConditional %424 %425 %426
+%425 = OpLabel
+%427 = OpLoad %bool %b
 OpSelectionMerge %429 None
 OpBranchConditional %427 %428 %429
 %428 = OpLabel
-%430 = OpLoad %int %i
-%431 = OpLoad %v2int %i2
-%432 = OpCompositeExtract %int %431 0
-%433 = OpIMul %int %430 %432
-%434 = OpLoad %v3int %i3
-%435 = OpCompositeExtract %int %434 0
-%436 = OpIMul %int %433 %435
-%437 = OpLoad %v4int %i4
-%438 = OpCompositeExtract %int %437 0
-%439 = OpIMul %int %436 %438
-%440 = OpIEqual %bool %int_1 %439
+%430 = OpLoad %v2bool %b2
+%431 = OpCompositeExtract %bool %430 0
 OpBranch %429
 %429 = OpLabel
-%441 = OpPhi %bool %false %402 %440 %428
-OpStore %ok %441
-%442 = OpLoad %bool %ok
-OpSelectionMerge %444 None
-OpBranchConditional %442 %443 %444
-%443 = OpLabel
-%445 = OpLoad %bool %b
-OpSelectionMerge %447 None
-OpBranchConditional %445 %446 %447
+%432 = OpPhi %bool %false %425 %431 %428
+OpSelectionMerge %434 None
+OpBranchConditional %432 %433 %434
+%433 = OpLabel
+%435 = OpLoad %v3bool %b3
+%436 = OpCompositeExtract %bool %435 0
+OpBranch %434
+%434 = OpLabel
+%437 = OpPhi %bool %false %429 %436 %433
+OpSelectionMerge %439 None
+OpBranchConditional %437 %438 %439
+%438 = OpLabel
+%440 = OpLoad %v4bool %b4
+%441 = OpCompositeExtract %bool %440 0
+OpBranch %439
+%439 = OpLabel
+%442 = OpPhi %bool %false %434 %441 %438
+OpBranch %426
+%426 = OpLabel
+%443 = OpPhi %bool %false %411 %442 %439
+OpStore %ok %443
+%444 = OpLoad %bool %ok
+OpSelectionMerge %448 None
+OpBranchConditional %444 %446 %447
 %446 = OpLabel
-%448 = OpLoad %v2bool %b2
-%449 = OpCompositeExtract %bool %448 0
-OpBranch %447
+%449 = OpAccessChain %_ptr_Uniform_v4float %32 %int_0
+%450 = OpLoad %v4float %449
+OpStore %445 %450
+OpBranch %448
 %447 = OpLabel
-%450 = OpPhi %bool %false %443 %449 %446
-OpSelectionMerge %452 None
-OpBranchConditional %450 %451 %452
-%451 = OpLabel
-%453 = OpLoad %v3bool %b3
-%454 = OpCompositeExtract %bool %453 0
-OpBranch %452
-%452 = OpLabel
-%455 = OpPhi %bool %false %447 %454 %451
-OpSelectionMerge %457 None
-OpBranchConditional %455 %456 %457
-%456 = OpLabel
-%458 = OpLoad %v4bool %b4
-%459 = OpCompositeExtract %bool %458 0
-OpBranch %457
-%457 = OpLabel
-%460 = OpPhi %bool %false %452 %459 %456
-OpBranch %444
-%444 = OpLabel
-%461 = OpPhi %bool %false %429 %460 %457
-OpStore %ok %461
-%462 = OpLoad %bool %ok
-OpSelectionMerge %466 None
-OpBranchConditional %462 %464 %465
-%464 = OpLabel
-%467 = OpAccessChain %_ptr_Uniform_v4float %32 %int_0
-%468 = OpLoad %v4float %467
-OpStore %463 %468
-OpBranch %466
-%465 = OpLabel
-%469 = OpAccessChain %_ptr_Uniform_v4float %32 %int_1
-%470 = OpLoad %v4float %469
-OpStore %463 %470
-OpBranch %466
-%466 = OpLabel
-%471 = OpLoad %v4float %463
-OpReturnValue %471
+%451 = OpAccessChain %_ptr_Uniform_v4float %32 %int_1
+%452 = OpLoad %v4float %451
+OpStore %445 %452
+OpBranch %448
+%448 = OpLabel
+%453 = OpLoad %v4float %445
+OpReturnValue %453
 OpFunctionEnd