llvm-project/llvm/test/CodeGen/DirectX/resource_counter_error.ll
Helena Kotas ddf8cd3c6c
[HLSL][DirectX] Remove uniformity bit from resource initialization intrinsics (#155332)
Removes uniformity bit from resource initialization intrinsics `llvm.{dx|spv}.resource.handlefrombinding` and `llvm.{dx|spv}.resource.handlefromimplicitbinding`. The flag currently always set to `false`. It should be derived from resource analysis and not provided by codegen.

Closes #135452
2025-08-28 09:12:36 -07:00

11 lines
577 B
LLVM

; RUN: not opt -S -passes='dxil-post-optimization-validation' -mtriple=dxil-pc-shadermodel6.3-library %s 2>&1 | FileCheck %s
; CHECK: RWStructuredBuffers may increment or decrement their counters, but not both.
define void @inc_and_dec() {
entry:
%handle = call target("dx.RawBuffer", float, 1, 0) @llvm.dx.resource.handlefrombinding(i32 1, i32 2, i32 3, i32 4, ptr null)
call i32 @llvm.dx.resource.updatecounter(target("dx.RawBuffer", float, 1, 0) %handle, i8 -1)
call i32 @llvm.dx.resource.updatecounter(target("dx.RawBuffer", float, 1, 0) %handle, i8 1)
ret void
}