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:
Johan Engelen 2016-06-27 11:38:06 +02:00
parent df5f52f3af
commit ccea089f07

View file

@ -91,7 +91,6 @@ void remapBlocksValue(std::vector<llvm::BasicBlock *> &blocks,
// - redirect srcTarget to continueWith
// - set "funclet" attribute inside catch/cleanup pads
// - inside funclets, replace "unreachable" with "branch cleanupret"
// - disable inlining inside a funclet
void cloneBlocks(const std::vector<llvm::BasicBlock *> &srcblocks,
std::vector<llvm::BasicBlock *> &blocks,
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)) {
auto invoke = llvm::InvokeInst::Create(
IInst, llvm::OperandBundleDef("funclet", funclet));
invoke->setIsNoInline();
newInst = invoke;
} else if (auto CInst = llvm::dyn_cast<llvm::CallInst> (Inst)) {
auto call = llvm::CallInst::Create(
CInst, llvm::OperandBundleDef("funclet", funclet));
call->setIsNoInline();
newInst = call;
} else if (funclet && llvm::isa<llvm::UnreachableInst>(Inst)) {
newInst = llvm::BranchInst::Create(continueWith); // to cleanupret