[clang] [llvm] [HLSL][SPIRV] Add IntrConvergent to convergent intrinsics (PR #211256)

Tim Corringham via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 13 11:00:53 PDT 2026


================
@@ -533,6 +533,18 @@ static Value *emitHlslClamp(CodeGenFunction &CGF, const CallExpr *E,
   return Clamp;
 }
 
+static CallInst *emitResourceIntrinsic(CodeGenFunction &CGF, llvm::Type *RetTy,
+                                       Intrinsic::ID ID,
+                                       ArrayRef<Value *> Args) {
+  SmallVector<llvm::Type *> ArgTys;
+  ArgTys.reserve(Args.size());
+  for (Value *Arg : Args)
+    ArgTys.push_back(Arg->getType());
+  Function *IntrFn = Intrinsic::getOrInsertDeclaration(&CGF.CGM.getModule(), ID,
+                                                       RetTy, ArgTys);
+  return CGF.EmitRuntimeCall(IntrFn, Args);
----------------
tcorringham wrote:

It is similar but not quite the same as it looks up the overloaded declaration, so it is just a convenient helper that avoids having to do this at each call site.
I have added a comment to describe why it exists and what to use it for.

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


More information about the llvm-commits mailing list