[clang] [Clang][HLSL] Fix EmitRuntimeCall to use C calling convention for intrinsics (PR #197380)

Wenju He via cfe-commits cfe-commits at lists.llvm.org
Wed May 13 01:12:05 PDT 2026


================
@@ -5233,7 +5233,11 @@ llvm::CallInst *CodeGenFunction::EmitRuntimeCall(llvm::FunctionCallee callee,
                                                  const llvm::Twine &name) {
   llvm::CallInst *call = Builder.CreateCall(
       callee, args, getBundlesForFunclet(callee.getCallee()), name);
-  call->setCallingConv(getRuntimeCC());
+  // Intrinsics must use CallingConv::C; only apply the runtime CC to
+  // non-intrinsic callees.
+  if (auto *F = dyn_cast<llvm::Function>(callee.getCallee());
----------------
wenju-he wrote:

added a new variant function EmitIntrinsicCall

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


More information about the cfe-commits mailing list