[clang] Implement `ByteAddressBuffer` Load/Store methods (PR #176058)

Kaitlin Peng via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 15 15:58:44 PST 2026


================
@@ -432,6 +432,9 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID,
 
     if (RT->getAttrs().RawBuffer) {
       Value *Offset = Builder.getInt32(0);
+      // Offset is poison for ByteAddressBuffer
----------------
kmpeng wrote:

>From [here](https://github.com/llvm/llvm-project/blob/main/llvm/docs/DirectX/DXILResources.rst#:~:text=Note%20that%20RawBuffer%20loads%20represent%20either%20%22structured%22%20accesses%2C%20as%20in%20HLSL%27s%20StructuredBuffer%3CT%3E%2C%20or%20a%20%22raw%22%20access%2C%20as%20in%20HLSL%27s%20%22ByteAddressBuffer%22.%20The%20%25offset%20parameter%20is%20only%20used%20for%20structured%20accesses%2C%20and%20must%20be%20poison%20for%20raw%20accesses.), the `Offset` parameter needs to be `poison` for ByteAddressBuffers. I guess I should replace "is poison" with "needs to be"

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


More information about the cfe-commits mailing list