summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/InlineFunction.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2008-04-07 00:08:48 +0000
committerDale Johannesen <dalej@apple.com>2008-04-07 00:08:48 +0000
commit87e484f08b5f137bbc4384176890df4152dd8946 (patch)
treee50d8f7fd1d820424bf0ffca38e653d9aed90080 /llvm/lib/Transforms/Utils/InlineFunction.cpp
parentb9dfb03ddb1382d39d7dfb19255fdf1331c8ff37 (diff)
downloadbcm5719-llvm-87e484f08b5f137bbc4384176890df4152dd8946.tar.gz
bcm5719-llvm-87e484f08b5f137bbc4384176890df4152dd8946.zip
Mark calls to llvm.stacksave, llvm.stackrestore as
nounwind. When such calls are inlined into something else that is invoked, they were getting changed to invokes, which is badness. llvm-svn: 49299
Diffstat (limited to 'llvm/lib/Transforms/Utils/InlineFunction.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/InlineFunction.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp
index 2e349845641..5e56c4e4516 100644
--- a/llvm/lib/Transforms/Utils/InlineFunction.cpp
+++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp
@@ -368,12 +368,14 @@ bool llvm::InlineFunction(CallSite CS, CallGraph *CG, const TargetData *TD) {
// Insert the llvm.stacksave.
CallInst *SavedPtr = CallInst::Create(StackSave, "savedstack",
FirstNewBlock->begin());
+ SavedPtr->setDoesNotThrow();
if (CG) CallerNode->addCalledFunction(SavedPtr, StackSaveCGN);
// Insert a call to llvm.stackrestore before any return instructions in the
// inlined function.
for (unsigned i = 0, e = Returns.size(); i != e; ++i) {
CallInst *CI = CallInst::Create(StackRestore, SavedPtr, "", Returns[i]);
+ CI->setDoesNotThrow();
if (CG) CallerNode->addCalledFunction(CI, StackRestoreCGN);
}
@@ -386,7 +388,8 @@ bool llvm::InlineFunction(CallSite CS, CallGraph *CG, const TargetData *TD) {
for (Function::iterator BB = FirstNewBlock, E = Caller->end();
BB != E; ++BB)
if (UnwindInst *UI = dyn_cast<UnwindInst>(BB->getTerminator())) {
- CallInst::Create(StackRestore, SavedPtr, "", UI);
+ CallInst *CI = CallInst::Create(StackRestore, SavedPtr, "", UI);
+ CI->setDoesNotThrow();
++NumStackRestores;
}
}
OpenPOWER on IntegriCloud