diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2022-07-27 20:11:54 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2023-02-08 19:04:48 +0000 |
| commit | 972a253a57b6f144b0e4a3e2080a2a0076ec55a0 (patch) | |
| tree | a8aeeb0997a0a52500f1fa0644244206cf71df94 /contrib/llvm-project/clang/lib/CodeGen/CGCall.cpp | |
| parent | fcaf7f8644a9988098ac6be2165bce3ea4786e91 (diff) | |
| parent | 08e8dd7b9db7bb4a9de26d44c1cbfd24e869c014 (diff) | |
Diffstat (limited to 'contrib/llvm-project/clang/lib/CodeGen/CGCall.cpp')
| -rw-r--r-- | contrib/llvm-project/clang/lib/CodeGen/CGCall.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/contrib/llvm-project/clang/lib/CodeGen/CGCall.cpp b/contrib/llvm-project/clang/lib/CodeGen/CGCall.cpp index 104a30dd6b25..dfa78bf59c65 100644 --- a/contrib/llvm-project/clang/lib/CodeGen/CGCall.cpp +++ b/contrib/llvm-project/clang/lib/CodeGen/CGCall.cpp @@ -4473,17 +4473,22 @@ llvm::CallInst *CodeGenFunction::EmitRuntimeCall(llvm::FunctionCallee callee, // they are nested within. SmallVector<llvm::OperandBundleDef, 1> CodeGenFunction::getBundlesForFunclet(llvm::Value *Callee) { - SmallVector<llvm::OperandBundleDef, 1> BundleList; // There is no need for a funclet operand bundle if we aren't inside a // funclet. if (!CurrentFuncletPad) - return BundleList; - - // Skip intrinsics which cannot throw. - auto *CalleeFn = dyn_cast<llvm::Function>(Callee->stripPointerCasts()); - if (CalleeFn && CalleeFn->isIntrinsic() && CalleeFn->doesNotThrow()) - return BundleList; + return (SmallVector<llvm::OperandBundleDef, 1>()); + + // Skip intrinsics which cannot throw (as long as they don't lower into + // regular function calls in the course of IR transformations). + if (auto *CalleeFn = dyn_cast<llvm::Function>(Callee->stripPointerCasts())) { + if (CalleeFn->isIntrinsic() && CalleeFn->doesNotThrow()) { + auto IID = CalleeFn->getIntrinsicID(); + if (!llvm::IntrinsicInst::mayLowerToFunctionCall(IID)) + return (SmallVector<llvm::OperandBundleDef, 1>()); + } + } + SmallVector<llvm::OperandBundleDef, 1> BundleList; BundleList.emplace_back("funclet", CurrentFuncletPad); return BundleList; } |
