Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spirv-val: Checks for OpPhi do not check for duplicate predecessors #3918

Closed
afd opened this issue Oct 15, 2020 · 0 comments · Fixed by #3919
Closed

spirv-val: Checks for OpPhi do not check for duplicate predecessors #3918

afd opened this issue Oct 15, 2020 · 0 comments · Fixed by #3919
Assignees

Comments

@afd
Copy link
Contributor

afd commented Oct 15, 2020

I found that this SPIR-V is accepted by the validator - note the OpPhis at the end, which have multiple entries for %8 but are missing entries for %9.

               OpCapability Shader
          %1 = OpExtInstImport "GLSL.std.450"
               OpMemoryModel Logical GLSL450
               OpEntryPoint Fragment %4 "main"
               OpExecutionMode %4 OriginUpperLeft
               OpSource ESSL 320
          %2 = OpTypeVoid
          %3 = OpTypeFunction %2
          %6 = OpTypeBool
         %30 = OpTypeVector %6 3
         %31 = OpTypeVector %6 2
         %32 = OpTypeVector %6 4
          %7 = OpConstantTrue %6
         %10 = OpTypeInt 32 1
         %11 = OpTypeVector %10 3
         %40 = OpTypeFloat 32
         %41 = OpTypeVector %40 4
         %12 = OpUndef %11
         %60 = OpUndef %41
	 %61 = OpConstantComposite %31 %7 %7
          %4 = OpFunction %2 None %3
          %5 = OpLabel
               OpSelectionMerge %20 None
               OpBranchConditional %7 %8 %9
          %8 = OpLabel
               OpBranch %20
          %9 = OpLabel
               OpBranch %20
         %20 = OpLabel
         %21 = OpPhi %11 %12 %8 %12 %8
         %22 = OpPhi %11 %12 %8 %12 %8
         %23 = OpPhi %41 %60 %8 %60 %8
         %24 = OpPhi %31 %61 %8 %61 %8
         %25 = OpPhi %41 %60 %8 %60 %8
               OpReturn
               OpFunctionEnd
@afd afd self-assigned this Oct 15, 2020
afd added a commit to afd/SPIRV-Tools that referenced this issue Oct 15, 2020
afd added a commit to afd/SPIRV-Tools that referenced this issue Oct 16, 2020
@afd afd closed this as completed in #3919 Oct 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant