KhronosGroup / KhronosGroup/SPIRV-Tools

SimplificationPass should fold FConvert of float32 constant to float16

Open
#2,820 1 comment 0 reactions 0 assignees View on GitHub
component:optimization
Dominant language
C++
Stars
1.4k
Forks
709
Avg merge
1d 22h
Merged PRs (30d)
28

Description

ConvertToHalfPass will generate the following:

%float_0_5 = OpConstant %float 0.5
...
%156 = OpFConvert %half %float_0_5

It would be nice if SimplificationPass would fold this into

%half_0_5 = OpConstant %half 0.5

Attention @s-perron

Contributor guide

Open the contributing guide

Research direction

Start by locating SimplificationPass and ConvertToHalfPass, then inspect existing constant-folding tests for floating-point conversions. Done means the shown float32 constant conversion is folded into the equivalent float16 constant, with coverage in the relevant test suite.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.