================
@@ -5448,12 +5448,13 @@ CodeGenFunction::getBundlesForFunclet(llvm::Value 
*Callee) {
 llvm::CallInst *CodeGenFunction::EmitRuntimeCall(llvm::FunctionCallee callee,
                                                  ArrayRef<llvm::Value *> args,
                                                  const llvm::Twine &name) {
-  llvm::CallInst *call = Builder.CreateCall(
-      callee, args, getBundlesForFunclet(callee.getCallee()), name);
+  SmallVector<llvm::OperandBundleDef> BundleList =
+      getBundlesForFunclet(callee.getCallee());
+  if (auto *F = dyn_cast<llvm::Function>(callee.getCallee());
+      F && F->isConvergent())
----------------
efriedma-quic wrote:

You're saying that indirect calls shouldn't go through this codepath, or 
CodeGenFunction::GenerateCXXGlobalCleanUpFunc?

That's... maybe mostly correct?  GenerateCXXGlobalCleanUpFunc should only be 
calling either helper functions explicitly created to be called by 
GenerateCXXGlobalCleanUpFunc, or actual destructor declarations.  And 
EmitRuntimeCall gets used for a bunch of stuff, but mostly not calls written by 
the user.

I'm not sure we consistently end up with a literal "llvm::Function", though; 
you could easily end up with a GlobalAlias.

Whatever we actually get here, we need to more aggressively assert that the 
callee actually has the form we're expecting, or else we'll end up obscure 
miscompiles or crashes.

https://github.com/llvm/llvm-project/pull/230765
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to