[clang] [llvm] [HLSL] Implement Texture2D type and Sample method in Clang (PR #177240)

Steven Perron via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 27 10:39:40 PST 2026


================
@@ -37,7 +37,7 @@ export void foo() {
 // CHECK-SAME: (ptr {{.*}} @Buf1, i32 noundef 1, i32 noundef 2, i32 noundef 1, i32 noundef 0, ptr noundef @[[Buf1Str]])
 
 // Buf1 initialization part 2 - body of ByteAddressBuffer::__createFromBinding
-// CHECK: define {{.*}} void @hlsl::ByteAddressBuffer::__createFromBinding(unsigned int, unsigned int, int, unsigned int, char const*)
+// CHECK: define linkonce_odr hidden void @hlsl::ByteAddressBuffer::__createFromBinding(unsigned int, unsigned int, int, unsigned int, char const*)
----------------
s-perron wrote:

Not strictly. I mechanically had the linkonce_odr explicitly checked for the builtin fuctions. It is important because if they do not have the attribute, they will not be deleted by the optimizer after inlining, which causes problems for the backend because we have store of the opaque handles.

I'd like to keep it.

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


More information about the llvm-commits mailing list