mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-05 17:43:35 +03:00
Remove explicit noinline
call attribute inside SEH catch/cleanup pads.
See https://llvm.org/bugs/show_bug.cgi?id=25162 However LLVM inliner now knows not to inline functions inside cleanup pads and so this is no longer needed. I have tested with clang (trunk) and clang also no longer marks function calls explicitly with noinline: the inliner no longer tries to inline `alwaysinline` functions. The change is necesary because setting `noinline` conflicts with functions that have `alwaysinline` attribute added (due to `pragma(inline, true)`).
This commit is contained in:
parent
df5f52f3af
commit
ccea089f07
1 changed files with 0 additions and 3 deletions
|
@ -91,7 +91,6 @@ void remapBlocksValue(std::vector<llvm::BasicBlock *> &blocks,
|
||||||
// - redirect srcTarget to continueWith
|
// - redirect srcTarget to continueWith
|
||||||
// - set "funclet" attribute inside catch/cleanup pads
|
// - set "funclet" attribute inside catch/cleanup pads
|
||||||
// - inside funclets, replace "unreachable" with "branch cleanupret"
|
// - inside funclets, replace "unreachable" with "branch cleanupret"
|
||||||
// - disable inlining inside a funclet
|
|
||||||
void cloneBlocks(const std::vector<llvm::BasicBlock *> &srcblocks,
|
void cloneBlocks(const std::vector<llvm::BasicBlock *> &srcblocks,
|
||||||
std::vector<llvm::BasicBlock *> &blocks,
|
std::vector<llvm::BasicBlock *> &blocks,
|
||||||
llvm::BasicBlock *continueWith, llvm::BasicBlock *unwindTo,
|
llvm::BasicBlock *continueWith, llvm::BasicBlock *unwindTo,
|
||||||
|
@ -116,12 +115,10 @@ void cloneBlocks(const std::vector<llvm::BasicBlock *> &srcblocks,
|
||||||
if (auto IInst = llvm::dyn_cast<llvm::InvokeInst> (Inst)) {
|
if (auto IInst = llvm::dyn_cast<llvm::InvokeInst> (Inst)) {
|
||||||
auto invoke = llvm::InvokeInst::Create(
|
auto invoke = llvm::InvokeInst::Create(
|
||||||
IInst, llvm::OperandBundleDef("funclet", funclet));
|
IInst, llvm::OperandBundleDef("funclet", funclet));
|
||||||
invoke->setIsNoInline();
|
|
||||||
newInst = invoke;
|
newInst = invoke;
|
||||||
} else if (auto CInst = llvm::dyn_cast<llvm::CallInst> (Inst)) {
|
} else if (auto CInst = llvm::dyn_cast<llvm::CallInst> (Inst)) {
|
||||||
auto call = llvm::CallInst::Create(
|
auto call = llvm::CallInst::Create(
|
||||||
CInst, llvm::OperandBundleDef("funclet", funclet));
|
CInst, llvm::OperandBundleDef("funclet", funclet));
|
||||||
call->setIsNoInline();
|
|
||||||
newInst = call;
|
newInst = call;
|
||||||
} else if (funclet && llvm::isa<llvm::UnreachableInst>(Inst)) {
|
} else if (funclet && llvm::isa<llvm::UnreachableInst>(Inst)) {
|
||||||
newInst = llvm::BranchInst::Create(continueWith); // to cleanupret
|
newInst = llvm::BranchInst::Create(continueWith); // to cleanupret
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue