Skip to content

[HLSL][DX] Let dxil-resource-access handle resource access into unique global resources #165288

@luciechoi

Description

@luciechoi

The dxil-resource-access pass does not account for the case when a phi node of a resource handle is generated through optimizations (eg GVN) or for dynamic indices into a unique global resource.

This results in a convergent operation being moved through control flow illegally as described below:

For subgroup_uniform_control_flow.test
https://hlsl.godbolt.org/z/jcToeTv8q

Looking at the IR between DXC and Clang it appears Clang has performed an illegal optimization. It hoisted and duplicated the final WaveActiveMax into two operations in both the if (label 11) and else (label 19) blocks of the top-level if statement. This is not a legal optimization for a convergent operation, and is the likely cause of the issue.

Metadata

Metadata

Assignees

Type

No fields configured for Bug.

Projects

Status
Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions