@@ -8809,57 +8809,74 @@ TEST_F(AggressiveDCETest, ConvertDebugDeclareToDebugValue) {
88098809OpExtension "SPV_KHR_non_semantic_info"
88108810%1 = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
88118811OpMemoryModel Logical GLSL450
8812- OpEntryPoint Fragment %main "main" %input %output
8812+ OpEntryPoint Fragment %main "main" %input1 %input2 %output
88138813OpExecutionMode %main OriginUpperLeft
88148814%5 = OpString "test.hlsl"
88158815OpSource HLSL 600
88168816OpName %main "main"
8817- OpDecorate %input Location 0
8817+ OpDecorate %input1 Location 0
8818+ OpDecorate %input2 Location 1
88188819OpDecorate %output Location 0
88198820%void = OpTypeVoid
88208821%float = OpTypeFloat 32
8822+ %v3float = OpTypeVector %float 3
88218823%v4float = OpTypeVector %float 4
88228824%uint = OpTypeInt 32 0
88238825%uint_1 = OpConstant %uint 1
88248826%uint_2 = OpConstant %uint 2
88258827%uint_3 = OpConstant %uint 3
8828+ %uint_4 = OpConstant %uint 4
88268829%uint_32 = OpConstant %uint 32
88278830%uint_0 = OpConstant %uint 0
8831+ %float_0 = OpConstant %float 0
88288832%float_1 = OpConstant %float 1
8829- %_ptr_Input_v4float = OpTypePointer Input %v4float
8830- %_ptr_Output_v4float = OpTypePointer Output %v4float
8833+ %_ptr_Input_v3float = OpTypePointer Input %v3float
8834+ %_ptr_Output_v3float = OpTypePointer Output %v3float
88318835%_ptr_Function_v4float = OpTypePointer Function %v4float
8832- %input = OpVariable %_ptr_Input_v4float Input
8833- %output = OpVariable %_ptr_Output_v4float Output
8836+ %input1 = OpVariable %_ptr_Input_v3float Input
8837+ %input2 = OpVariable %_ptr_Input_v3float Input
8838+ %output = OpVariable %_ptr_Output_v3float Output
88348839%29 = OpTypeFunction %void
8840+ ; CHECK: [[initial:%\w+]] = OpConstantComposite
88358841; CHECK: [[expr:%\w+]] = OpExtInst %void {{%\w+}} DebugExpression
8836- ; CHECK: [[source:%\w+]] = OpExtInst %void {{%\w+}} DebugSource %5
8842+ ; CHECK: [[source:%\w+]] = OpExtInst %void {{%\w+}} DebugSource %6
88378843%30 = OpExtInst %void %1 DebugSource %5
88388844%31 = OpExtInst %void %1 DebugCompilationUnit %uint_1 %uint_3 %30 %uint_32
88398845; CHECK: [[basic:%\w+]] = OpExtInst %void {{%\w+}} DebugTypeBasic
88408846%32 = OpExtInst %void %1 DebugTypeBasic %5 %uint_32 %uint_3 %uint_0
8841- ; CHECK: [[vec_type:%\w+]] = OpExtInst %void {{%\w+}} DebugTypeVector [[basic]] %uint_3
8842- %33 = OpExtInst %void %1 DebugTypeVector %32 %uint_3
8847+ ; CHECK: [[vec_type:%\w+]] = OpExtInst %void {{%\w+}} DebugTypeVector [[basic]] %uint_4
8848+ %33 = OpExtInst %void %1 DebugTypeVector %32 %uint_4
88438849%34 = OpExtInst %void %1 DebugTypeFunction %uint_0 %void
88448850%35 = OpExtInst %void %1 DebugFunction %5 %34 %30 %uint_1 %uint_0 %31 %5 %uint_0 %uint_1
8851+ ; CHECK: [[local:%\w+]] = OpExtInst %void {{%\w+}} DebugLocalVariable %6 [[vec_type]] [[source]] %uint_1
88458852%36 = OpExtInst %void %1 DebugLocalVariable %5 %33 %30 %uint_1 %uint_0 %35 %uint_0
8846- ; CHECK: [[local:%\w+]] = OpExtInst %void {{%\w+}} DebugLocalVariable %5 [[vec_type]] [[source]] %uint_2
8847- %37 = OpExtInst %void %1 DebugLocalVariable %5 %33 %30 %uint_2 %uint_0 %35 %uint_0
88488853%38 = OpExtInst %void %1 DebugExpression
8854+ %initial_value = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_1
88498855%main = OpFunction %void None %29
88508856%39 = OpLabel
8851- %dead_var = OpVariable %_ptr_Function_v4float Function
8852- %live_var = OpVariable %_ptr_Function_v4float Function
8853- ; CHECK: [[live:%\w+]] = OpLoad
8854- %live_input = OpLoad %v4float %input
8855- %dead_value = OpCompositeConstruct %v4float %float_1 %float_1 %float_1 %float_1
8856- OpStore %dead_var %dead_value
8857+ %dead_pos_w = OpVariable %_ptr_Function_v4float Function
8858+ %live_var1 = OpVariable %_ptr_Function_v4float Function
8859+ %live_var2 = OpVariable %_ptr_Function_v4float Function
8860+ %input1_value = OpLoad %v3float %input1
8861+ %input2_value = OpLoad %v3float %input2
88578862; CHECK-NOT: DebugDeclare
8858- %40 = OpExtInst %void %1 DebugDeclare %36 %dead_var %38
8859- OpStore %live_var %live_input
8860- ; CHECK: DebugValue [[local]] [[live]] [[expr]]
8861- %41 = OpExtInst %void %1 DebugDeclare %37 %live_var %38
8862- OpStore %output %live_input
8863+ %40 = OpExtInst %void %1 DebugDeclare %36 %dead_pos_w %38
8864+ OpStore %dead_pos_w %initial_value
8865+ ; CHECK: DebugValue %30 [[initial]] %31
8866+ OpStore %live_var1 %initial_value
8867+ %computed1 = OpVectorTimesScalar %v3float %input1_value %float_1
8868+ %computed2 = OpFAdd %v3float %computed1 %input2_value
8869+ ; CHECK: [[new:%\w+]] = OpCompositeConstruct
8870+ %new_pos_w = OpCompositeConstruct %v4float %computed2 %float_1
8871+ OpStore %dead_pos_w %new_pos_w
8872+ ; CHECK: DebugValue %30 [[new]] %31
8873+ OpStore %live_var2 %new_pos_w
8874+ %loaded1 = OpLoad %v4float %live_var1
8875+ %loaded2 = OpLoad %v4float %live_var2
8876+ %pos_xyz1 = OpVectorShuffle %v3float %loaded1 %loaded1 0 1 2
8877+ %pos_xyz2 = OpVectorShuffle %v3float %loaded2 %loaded2 0 1 2
8878+ %mixed_result = OpFAdd %v3float %pos_xyz1 %pos_xyz2
8879+ OpStore %output %mixed_result
88638880OpReturn
88648881OpFunctionEnd
88658882)" ;
0 commit comments