{"action":"closed","issue":{"url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues/1075","repository_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools","labels_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues/1075/labels{/name}","comments_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues/1075/comments","events_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues/1075/events","html_url":"https://github.com/KhronosGroup/SPIRV-Tools/issues/1075","id":280377255,"number":1075,"title":"ADCE deletes label, but leaves a branch to the label.","user":{"login":"s-perron","id":31666470,"avatar_url":"https://avatars1.githubusercontent.com/u/31666470?v=4","gravatar_id":"","url":"https://api.github.com/users/s-perron","html_url":"https://github.com/s-perron","followers_url":"https://api.github.com/users/s-perron/followers","following_url":"https://api.github.com/users/s-perron/following{/other_user}","gists_url":"https://api.github.com/users/s-perron/gists{/gist_id}","starred_url":"https://api.github.com/users/s-perron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s-perron/subscriptions","organizations_url":"https://api.github.com/users/s-perron/orgs","repos_url":"https://api.github.com/users/s-perron/repos","events_url":"https://api.github.com/users/s-perron/events{/privacy}","received_events_url":"https://api.github.com/users/s-perron/received_events","type":"User","site_admin":false},"labels":[{"id":285277876,"url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-12-08T05:35:38Z","updated_at":"2017-12-23T22:48:36Z","closed_at":"2017-12-23T22:48:36Z","author_association":"CONTRIBUTOR","body":"If an empty structured-if has a merge block that is also the continue target of a loop construct, the block in the if is removed, but the branch is left as is.  This leaves a use of a label id that has no definition.\r\n\r\nThe following SPIR-V demonstrates the problem.  Assemble it, and run it through ADCE.\r\n\r\n```\r\n               OpCapability Shader\r\n          %1 = OpExtInstImport \"GLSL.std.450\"\r\n               OpMemoryModel Logical GLSL450\r\n               OpEntryPoint Fragment %2 \"main\" %3\r\n               OpExecutionMode %2 OriginUpperLeft\r\n               OpSource GLSL 430\r\n               OpSourceExtension \"GL_GOOGLE_cpp_style_line_directive\"\r\n               OpSourceExtension \"GL_GOOGLE_include_directive\"\r\n               OpName %2 \"main\"\r\n               OpDecorate %3 Location 0\r\n          %4 = OpTypeVoid\r\n          %5 = OpTypeFunction %4\r\n          %6 = OpTypeFloat 32\r\n          %8 = OpConstant %6 0\r\n          %9 = OpTypeInt 32 1\r\n         %10 = OpTypePointer Function %9\r\n         %11 = OpConstant %9 0\r\n         %12 = OpConstant %9 10\r\n         %13 = OpTypeBool\r\n         %14 = OpConstant %6 1\r\n         %15 = OpConstant %9 1\r\n         %16 = OpTypePointer Output %6\r\n          %3 = OpVariable %16 Output\r\n          %2 = OpFunction %4 None %5\r\n         %20 = OpLabel\r\n               OpBranch %21\r\n         %21 = OpLabel\r\n         %22 = OpPhi %6 %8 %20 %23 %24\r\n         %25 = OpPhi %9 %11 %20 %26 %24\r\n               OpLoopMerge %27 %24 None\r\n               OpBranch %28\r\n         %28 = OpLabel\r\n         %29 = OpSLessThan %13 %25 %12\r\n               OpBranchConditional %29 %30 %27\r\n         %30 = OpLabel\r\n         %23 = OpFAdd %6 %22 %14\r\n         %31 = OpConvertFToS %9 %23\r\n         %32 = OpSGreaterThan %13 %25 %31\r\n               OpSelectionMerge %24 None\r\n               OpBranchConditional %32 %33 %24\r\n         %33 = OpLabel\r\n               OpBranch %24\r\n         %24 = OpLabel\r\n         %26 = OpIAdd %9 %25 %15\r\n               OpBranch %21\r\n         %27 = OpLabel\r\n               OpStore %3 %22\r\n               OpReturn\r\n               OpFunctionEnd\r\n```"}}
{"actor":{"display_login":"s-perron"}}