microsoft / microsoft/DirectXShaderCompiler

Usage of a matrix in a structure that is passed to groupshared memory does not get dead store eliminated

Open
#6,417 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug matrix-bug
Dominant language
C++
Stars
3.7k
Forks
900
Avg merge
2d 11h
Merged PRs (30d)
44

Description

Description
When passing a full matrix across to groupshared, elements that are never loaded don't have their stores properly deleted when the index is a compile time constant.

Steps to Reproduce

Add "#define TGSM_MATRIX" to the attached shader and see the number of "addrspace(3)" stores increase from 3 to 16 for the same structure.

Actual Behavior
Expected behavior is that there would only be 3 stores in either version of the shader.

Environment

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the attached tgsm_matrix.txt shader and reproduce the issue by adding #define TGSM_MATRIX. Compare the generated addrspace(3) stores in both variants, then trace the dead-store-elimination path responsible for the difference. Done means both versions produce only 3 stores, with coverage for the regression.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.