Skip to content

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

Open

Description

@bfavela

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

Activity

  1. added
    bug
    needs-triage
    on Mar 14, 2024
  2. added
    matrix-bug
    and removed
    needs-triage
    on Mar 15, 2024
  3. llvm-beanz commented on Mar 15, 2024

    @llvm-beanz
    Collaborator

    This may be caused by limitations in the legacy SROA pass that the DXIL SROA is based on. This may "just work" in upstream with modern SROA and dead store elimination. We should check this against upstream once the language and DXIL generation support are more complete.

    We're unlikely to address this in DXC unless something changes to push the priority higher.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmatrix-bug

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions