Index: lib/Transforms/IPO/Inliner.cpp =================================================================== --- lib/Transforms/IPO/Inliner.cpp +++ lib/Transforms/IPO/Inliner.cpp @@ -132,6 +132,12 @@ AdjustCallerSSPLevel(Caller, Callee); + // If the callee requires stack probes, we ensure that the caller will + // require those too + if (Callee->hasFnAttribute("probe-stack")) { + Caller->addFnAttr("probe-stack"); + } + // Look at all of the allocas that we inlined through this call site. If we // have already inlined other allocas through other calls into this function, // then we know that they have disjoint lifetimes and that we can merge them. Index: test/Transforms/Inline/inline-probe-stack.ll =================================================================== --- /dev/null +++ test/Transforms/Inline/inline-probe-stack.ll @@ -0,0 +1,12 @@ +; RUN: opt %s -inline -S | FileCheck %s + +define internal void @inner() "probe-stack" { + ret void +} + +define void @outer() { + call void @inner() + ret void +} +; CHECK: define void @outer() #0 +; CHECK: attributes #0 = { "probe-stack" }