llvm / llvm/llvm-project

[HLSL][DirectX] `dxil-resource-access` pass does not account for updatecounters

Closed
#222,400 0 comments 0 reactions 1 assignee Claimed by @spall View on GitHub
backend:DirectX HLSL
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

After https://github.com/llvm/llvm-project/pull/222130 landed and the `IsTokenLike` was taken off of the resource target extension type, it appears a new pattern of resource access through phis makes it way to the `dxil-resource-access` pass. Namely, there can be an `llvm.dx.resource.updatecounter` intrinsic in the resource call-chain.

Eg: https://godbolt.org/z/7fxjzPraE. We can see that the `dxil-resource-access` pass fails to legalize the resource access.

This causes an unsuccessful traversal of the resource chain to replace the resources with indices and so there remains a phi of the resource during `dxil-op-lowering` causing the assertion crashes visible [here](https://github.com/llvm/offload-test-suite/actions/runs/34350088355/job/102477252267#step:13:607).

This should likely be addressed by updating the `dxil-resource-access` pass to account for the `updatecounter` intrinsic

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.