KhronosGroup / KhronosGroup/SPIRV-Tools

OpConditionalEntryPointINTEL not handled by spirv-opt

Open
#6,277 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
1.4k
Forks
709
Avg merge
1d 22h
Merged PRs (30d)
28

Description

This is to track some disabled tests in spirv-opt.
The support for SPV_INTEL_function_variants being quite recent, seems like some part are missing in spirv-opt.

Can repro at 6c6152b64fb1f14d84c7b55b56af32d151e6b372 by running:
```
./build/tools/spirv-as /tmp/1.spv -o - | ./build/tools/spirv-opt -Os - -o /tmp/1
error: line 0: Unhandled inst type (opcode: 6249) found outside function definition.
```

with the following code:

```spirv
OpCapability Shader
OpCapability Geometry
OpCapability SpecConditionalINTEL
OpExtension "SPV_INTEL_function_variants"
OpMemoryModel Logical GLSL450
OpConditionalEntryPointINTEL %false Fragment %ps_main "ps_main" %in_var_POSITION %out_var_SV_Target
OpExecutionMode %ps_main OriginUpperLeft
OpSource HLSL 660
OpName %in_var_POSITION "in.var.POSITION"
OpName %out_var_SV_Target "out.var.SV_Target"
OpName %ps_main "ps_main"
OpDecorate %in_var_POSITION Location 0
OpDecorate %out_var_SV_Target Location 0
%bool = OpTypeBool
%false = OpSpecConstantFalse %bool
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Input_v4float = OpTypePointer Input %v4float
%_ptr_Output_v4float = OpTypePointer Output %v4float
%void = OpTypeVoid
%9 = OpTypeFunction %void
%in_var_POSITION = OpVariable %_ptr_Input_v4float Input
%out_var_SV_Target = OpVariable %_ptr_Output_v4float Output
%ps_main = OpFunction %void None %9
%10 = OpLabel
%11 = OpLoad %v4float %in_var_POSITION
OpStore %out_var_SV_Target %11
OpReturn
OpFunctionEnd
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure at commit 6c6152b64fb1f14d84c7b55b56af32d151e6b372 with spirv-as piped into spirv-opt -Os, then inspect the disabled spirv-opt tests for SPV_INTEL_function_variants. Trace how OpConditionalEntryPointINTEL is handled outside function definitions; done means the repro no longer reports an unhandled opcode and the relevant tests can be enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.