Skip to content

[SPIR-V] Fold constant instructions when there's -Gis flag #7732

Open

Description

@luciechoi

https://godbolt.org/z/95WvzPfYz

Description
Context

We should fold certain instructions even when there's -Gis flag, such when all parameters are known constants.

Steps to Reproduce

// RUN: %dxc -spirv -fspv-target-env=vulkan1.3 -enable-16bit-types -Gis -HV 202x -T cs_6_5 %s

RWStructuredBuffer<float4> Out1 : register(u5);

[numthreads(1,1,1)]
void main() {
    // both of these are hitting the assert
    Out1[0] = pow(float4(2, 4, 1.5, 8), float4(3, 0.5, 2, 0.33333333));
}

is said to produce the error

# .---command stderr------------
# | Internal compiler error: LLVM Assert
# `-----------------------------
# error: command failed with exit status: 0xe0000001
Error: assert((!HasStatus(inst) || Status(inst) != SSAPropagator::kNotInteresting) && "Unsettled value")
File:
/home/kaitlinpeng/DirectXShaderCompiler/external/SPIRV-Tools/source/opt/propagator.cpp(265)
Func:   operator()
Illegal instruction (core dumped)

Actual Behavior
The instructions shouldn't throw errors and properly fold even when there's -Gis flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugspirv

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions