mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-21 10:49:14 +00:00
tint: Use MergeReturn transform in SPIR-V backend
Bug: tint:1627 Change-Id: I5a3639543b076e6f666bfcca8c61b22db7f2630e Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/107363 Commit-Queue: James Price <jrprice@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
committed by
Dawn LUCI CQ
parent
a3343d92d3
commit
3e1bc0a6da
@@ -1,7 +1,7 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 37
|
||||
; Bound: 43
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
@@ -9,17 +9,22 @@
|
||||
OpExecutionMode %unused_entry_point LocalSize 1 1 1
|
||||
OpName %unused_entry_point "unused_entry_point"
|
||||
OpName %f "f"
|
||||
OpName %tint_return_flag "tint_return_flag"
|
||||
OpName %tint_return_value "tint_return_value"
|
||||
OpName %i "i"
|
||||
OpName %j "j"
|
||||
%void = OpTypeVoid
|
||||
%1 = OpTypeFunction %void
|
||||
%int = OpTypeInt 32 1
|
||||
%5 = OpTypeFunction %int
|
||||
%bool = OpTypeBool
|
||||
%_ptr_Function_bool = OpTypePointer Function %bool
|
||||
%12 = OpConstantNull %bool
|
||||
%_ptr_Function_int = OpTypePointer Function %int
|
||||
%11 = OpConstantNull %int
|
||||
%15 = OpConstantNull %int
|
||||
%int_1 = OpConstant %int 1
|
||||
%int_4 = OpConstant %int 4
|
||||
%bool = OpTypeBool
|
||||
%true = OpConstantTrue %bool
|
||||
%int_2 = OpConstant %int 2
|
||||
%unused_entry_point = OpFunction %void None %1
|
||||
%4 = OpLabel
|
||||
@@ -27,45 +32,52 @@
|
||||
OpFunctionEnd
|
||||
%f = OpFunction %int None %5
|
||||
%8 = OpLabel
|
||||
%i = OpVariable %_ptr_Function_int Function %11
|
||||
%j = OpVariable %_ptr_Function_int Function %11
|
||||
OpBranch %13
|
||||
%13 = OpLabel
|
||||
OpLoopMerge %14 %15 None
|
||||
OpBranch %16
|
||||
%16 = OpLabel
|
||||
%17 = OpLoad %int %i
|
||||
%19 = OpIAdd %int %17 %int_1
|
||||
OpStore %i %19
|
||||
%20 = OpLoad %int %i
|
||||
%22 = OpSGreaterThan %bool %20 %int_4
|
||||
OpSelectionMerge %24 None
|
||||
OpBranchConditional %22 %25 %24
|
||||
%25 = OpLabel
|
||||
OpReturnValue %int_1
|
||||
%24 = OpLabel
|
||||
OpBranch %26
|
||||
%26 = OpLabel
|
||||
OpLoopMerge %27 %28 None
|
||||
OpBranch %29
|
||||
%tint_return_flag = OpVariable %_ptr_Function_bool Function %12
|
||||
%tint_return_value = OpVariable %_ptr_Function_int Function %15
|
||||
%i = OpVariable %_ptr_Function_int Function %15
|
||||
%j = OpVariable %_ptr_Function_int Function %15
|
||||
OpBranch %18
|
||||
%18 = OpLabel
|
||||
OpLoopMerge %19 %20 None
|
||||
OpBranch %21
|
||||
%21 = OpLabel
|
||||
%22 = OpLoad %int %i
|
||||
%24 = OpIAdd %int %22 %int_1
|
||||
OpStore %i %24
|
||||
%25 = OpLoad %int %i
|
||||
%27 = OpSGreaterThan %bool %25 %int_4
|
||||
OpSelectionMerge %28 None
|
||||
OpBranchConditional %27 %29 %28
|
||||
%29 = OpLabel
|
||||
%30 = OpLoad %int %j
|
||||
%31 = OpIAdd %int %30 %int_1
|
||||
OpStore %j %31
|
||||
%32 = OpLoad %int %j
|
||||
%33 = OpSGreaterThan %bool %32 %int_4
|
||||
OpSelectionMerge %34 None
|
||||
OpBranchConditional %33 %35 %34
|
||||
%35 = OpLabel
|
||||
OpReturnValue %int_2
|
||||
%34 = OpLabel
|
||||
OpBranch %28
|
||||
OpStore %tint_return_flag %true
|
||||
OpStore %tint_return_value %int_1
|
||||
OpBranch %19
|
||||
%28 = OpLabel
|
||||
OpBranch %26
|
||||
%27 = OpLabel
|
||||
OpBranch %15
|
||||
%15 = OpLabel
|
||||
OpBranch %13
|
||||
%14 = OpLabel
|
||||
OpReturnValue %11
|
||||
OpBranch %31
|
||||
%31 = OpLabel
|
||||
OpLoopMerge %32 %33 None
|
||||
OpBranch %34
|
||||
%34 = OpLabel
|
||||
%35 = OpLoad %int %j
|
||||
%36 = OpIAdd %int %35 %int_1
|
||||
OpStore %j %36
|
||||
%37 = OpLoad %int %j
|
||||
%38 = OpSGreaterThan %bool %37 %int_4
|
||||
OpSelectionMerge %39 None
|
||||
OpBranchConditional %38 %40 %39
|
||||
%40 = OpLabel
|
||||
OpStore %tint_return_flag %true
|
||||
OpStore %tint_return_value %int_2
|
||||
OpBranch %32
|
||||
%39 = OpLabel
|
||||
OpBranch %33
|
||||
%33 = OpLabel
|
||||
OpBranch %31
|
||||
%32 = OpLabel
|
||||
OpBranch %19
|
||||
%20 = OpLabel
|
||||
OpBranch %18
|
||||
%19 = OpLabel
|
||||
%42 = OpLoad %int %tint_return_value
|
||||
OpReturnValue %42
|
||||
OpFunctionEnd
|
||||
|
||||
Reference in New Issue
Block a user