[clang] [Clang][AMDGPU] Add __builtin_amdgcn_s_buffer_load_<T> (PR #203352)

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 19 12:35:22 PDT 2026


================
@@ -31,6 +31,22 @@ using namespace llvm;
 
 namespace {
 
+static Value *emitAMDGPUSBufferLoadBuiltin(CodeGenFunction &CGF,
+                                           const CallExpr *E) {
+  llvm::Type *RetTy = CGF.ConvertType(E->getType());
+  Function *F = CGF.CGM.getIntrinsic(Intrinsic::amdgcn_s_buffer_load, RetTy);
+
+  Value *RsrcPtr = CGF.EmitScalarExpr(E->getArg(0));
+  llvm::Type *I128Ty = llvm::IntegerType::get(CGF.getLLVMContext(), 128);
+  llvm::Type *RsrcVecTy =
+      llvm::FixedVectorType::get(CGF.Builder.getInt32Ty(), 4);
+  Value *RsrcInt = CGF.Builder.CreatePtrToInt(RsrcPtr, I128Ty);
----------------
arsenm wrote:

Do we really not have pointer versions of this intrinsic already? 

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


More information about the cfe-commits mailing list