I tested an incrementing temp register index for each value. For a simple pass-through pixel shader, here is the SPIR-V function with SSA:
```%main = OpFunction %void None %3 %4 = OpLabel %13 = OpLoad %v4float %gl_FragCoord %14 = OpCompositeExtract %float %13 3 %16 = OpFDiv %float %float_1 %14 %17 = OpCompositeInsert %v4float %16 %13 3 OpStore %v0 %17 %21 = OpInBoundsAccessChain %_ptr_Private_float %v0 %uint_0 %22 = OpLoad %float %21 %24 = OpInBoundsAccessChain %_ptr_Private_float %v0 %uint_1 %25 = OpLoad %float %24 %27 = OpInBoundsAccessChain %_ptr_Private_float %v0 %uint_2 %28 = OpLoad %float %27 %30 = OpInBoundsAccessChain %_ptr_Private_float %v0 %uint_3 %31 = OpLoad %float %30 %33 = OpInBoundsAccessChain %_ptr_Output_float %o0 %uint_0 OpStore %33 %22 %34 = OpInBoundsAccessChain %_ptr_Output_float %o0 %uint_1 OpStore %34 %25 %35 = OpInBoundsAccessChain %_ptr_Output_float %o0 %uint_2 OpStore %35 %28 %36 = OpInBoundsAccessChain %_ptr_Output_float %o0 %uint_3 OpStore %36 %31 OpReturn OpFunctionEnd ```
And with temps:
```%main = OpFunction %void None %3 %4 = OpLabel %17 = OpLoad %v4float %gl_FragCoord %18 = OpCompositeExtract %float %17 3 %20 = OpFDiv %float %float_1 %18 %21 = OpCompositeInsert %v4float %20 %17 3 OpStore %v0 %21 %25 = OpInBoundsAccessChain %_ptr_Private_float %v0 %uint_0 %26 = OpLoad %float %25 %27 = OpInBoundsAccessChain %_ptr_Private_float %r0 %uint_0 OpStore %27 %26 %29 = OpInBoundsAccessChain %_ptr_Private_float %v0 %uint_1 %30 = OpLoad %float %29 %31 = OpInBoundsAccessChain %_ptr_Private_float %r1 %uint_0 OpStore %31 %30 %33 = OpInBoundsAccessChain %_ptr_Private_float %v0 %uint_2 %34 = OpLoad %float %33 %35 = OpInBoundsAccessChain %_ptr_Private_float %r2 %uint_0 OpStore %35 %34 %37 = OpInBoundsAccessChain %_ptr_Private_float %v0 %uint_3 %38 = OpLoad %float %37 %39 = OpInBoundsAccessChain %_ptr_Private_float %r3 %uint_0 OpStore %39 %38 %40 = OpInBoundsAccessChain %_ptr_Private_float %r0 %uint_0 %41 = OpLoad %float %40 %43 = OpInBoundsAccessChain %_ptr_Output_float %o0 %uint_0 OpStore %43 %41 %44 = OpInBoundsAccessChain %_ptr_Private_float %r1 %uint_0 %45 = OpLoad %float %44 %46 = OpInBoundsAccessChain %_ptr_Output_float %o0 %uint_1 OpStore %46 %45 %47 = OpInBoundsAccessChain %_ptr_Private_float %r2 %uint_0 %48 = OpLoad %float %47 %49 = OpInBoundsAccessChain %_ptr_Output_float %o0 %uint_2 OpStore %49 %48 %50 = OpInBoundsAccessChain %_ptr_Private_float %r3 %uint_0 %51 = OpLoad %float %50 %52 = OpInBoundsAccessChain %_ptr_Output_float %o0 %uint_3 OpStore %52 %51 OpReturn OpFunctionEnd ```
I can make it like this if necessary, but IMO using temps this way is an ugly hack which makes debugging SPIR-V traces harder. Once 1.9 is out, temps must be replaced with SSA because using them is a dead end. We should not attempt to implement a temp register allocator which works on DXIL control flow graphs.