Skip to content

[6.9] Validator failing to look through multi-level GEPs #8571

Description

@llvm-beanz

Description
When targeting SM 6.9 arrays of vectors are preserved in groupshared memory, which can result in multi-level GEP instructions for addressing into groupshared allocations. The DXIL validator was not updated to handle multi-level GEP instructions, which results in DXIL validation failures for otherwise valid cases.

Steps to Reproduce

RWStructuredBuffer<float> Out;

groupshared float3x3 g_mats[64];

[numthreads(64, 1, 1)]
void main(uint3 gtid : SV_GroupThreadID, uint3 dtid : SV_DispatchThreadID) {
  g_mats[gtid.x] = (float3x3)0;
  GroupMemoryBarrierWithGroupSync();

  for (uint k = 0; k < 8; ++k) {
    g_mats[gtid.x][0][0] += (float)k;
    g_mats[gtid.x][1][1] += (float)k;
    g_mats[gtid.x][2][2] += (float)k;
  }

  GroupMemoryBarrierWithGroupSync();

  if (gtid.x == 0) {
    float3x3 sum = g_mats[0];
    for (uint i = 1; i < 64; ++i)
      sum += g_mats[i];
    Out[dtid.x] = sum[0][0] + sum[1][1] + sum[2][2];
  }
}

Compiler Explorer

Environment

  • DXC version: 1.9+
  • Host Operating System: Any

Metadata

Metadata

Assignees

Labels

bugBug, regression, crashneeds-triageAwaiting triage

Type

No type
No fields configured for issues without a type.

Projects

Status
No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions