[clang] [HLSL] Rewrite inline HLSL intrinsics into TableGen (PR #188362)
Justin Bogner via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 31 22:41:14 PDT 2026
================
@@ -8,31 +8,28 @@ RWBuffer<float> A[10];
[numthreads(4,1,1)]
void main(uint GI : SV_GroupID) {
// CHECK: %[[GI:.*]] = load i32, ptr %GI.addr
- // CHECK: %[[NURI_1:.*]] = call {{.*}} i32 @hlsl::NonUniformResourceIndex(unsigned int)(i32 noundef %[[GI]])
+ // DXIL: %[[NURI_1:.*]] = call i32 @llvm.dx.resource.nonuniformindex(i32 %[[GI]])
+ // SPV: %[[NURI_1:.*]] = call i32 @llvm.spv.resource.nonuniformindex(i32 %[[GI]])
----------------
bogner wrote:
If we change the `RUN` lines to pass `-DTARGET=dx` and `-DTARGET=spv` we can just use a single set of CHECKs here that say `@llvm.[[TARGET]].resource...` - we do this in a number of the `CodeGenHLSL/builtins/` tests.
https://github.com/llvm/llvm-project/pull/188362
More information about the cfe-commits
mailing list