[llvm] [DirectX] Teach DXILResourceAccess about cbuffers (PR #164554)

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 10 10:17:08 PST 2025


================
@@ -0,0 +1,42 @@
+; RUN: opt -S -dxil-resource-access -mtriple=dxil %s | FileCheck %s
+;
+; Tests for dynamic indices into arrays in cbuffers.
+
+; cbuffer CB : register(b0) {
+;   uint s[10]; // offset   0,  size  4 (+12) * 10
+;   uint t[10]; // offset 160,  size  4 (+12) * 10
+; }
+%__cblayout_CB = type <{ <{ [9 x <{ i32, target("dx.Padding", 12) }>], i32 }> }>
----------------
bogner wrote:

Fixed, and used `t[12]` to make the difference clearer.

https://github.com/llvm/llvm-project/pull/164554


More information about the llvm-commits mailing list