Skip to content

spirv-opt: InlineExhaustivePass doesn't handle OpCopyObject of void #3704

@Vasniktel

Description

@Vasniktel

spirv-opt produces the following error

error: line 11: ID 8[%8] has not been defined
%9 = OpCopyObject %void %8

error: line 0: Validation failed after pass inline-entry-points-exhaustive

when executed with the following command spirv-opt <attached shader> -o out.spv --inline-entry-points-exhaustive --validate-after-all.

The following shader causes the trouble

               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
          %4 = OpFunction %2 None %3
          %5 = OpLabel
          %8 = OpFunctionCall %2 %6
          %9 = OpCopyObject %2 %8
               OpReturn
               OpFunctionEnd
          %6 = OpFunction %2 None %3
          %7 = OpLabel
               OpReturn
               OpFunctionEnd

Can be reproduced on c20995e.

Might be related to #3547.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions