diff options
author | Reid Kleckner <reid@kleckner.net> | 2015-02-11 01:23:16 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2015-02-11 01:23:16 +0000 |
commit | 96d011315aa01de179897eaf4e7baeddc5de1cda (patch) | |
tree | ccced202122ff25d6362be653140bfe079ab5925 /llvm/lib/Transforms/Utils/Local.cpp | |
parent | 58e985c2db3045f1416520212108f93c8c257b18 (diff) | |
download | llvm-96d011315aa01de179897eaf4e7baeddc5de1cda.zip llvm-96d011315aa01de179897eaf4e7baeddc5de1cda.tar.gz llvm-96d011315aa01de179897eaf4e7baeddc5de1cda.tar.bz2 |
Don't promote asynch EH invokes of nounwind functions to calls
If the landingpad of the invoke is using a personality function that
catches asynch exceptions, then it can catch a trap.
Also add some landingpads to invalid LLVM IR test cases that lack them.
Over-the-shoulder reviewed by David Majnemer.
llvm-svn: 228782
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/Local.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index b8c0a7e..4830568 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/lib/Transforms/Utils/Local.cpp @@ -17,6 +17,7 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/Statistic.h" +#include "llvm/Analysis/LibCallSemantics.h" #include "llvm/Analysis/InstructionSimplify.h" #include "llvm/Analysis/MemoryBuiltins.h" #include "llvm/Analysis/ValueTracking.h" @@ -1260,7 +1261,7 @@ static bool markAliveBlocks(BasicBlock *BB, if (isa<ConstantPointerNull>(Callee) || isa<UndefValue>(Callee)) { changeToUnreachable(II, true); Changed = true; - } else if (II->doesNotThrow()) { + } else if (II->doesNotThrow() && canSimplifyInvokeNoUnwind(II)) { if (II->use_empty() && II->onlyReadsMemory()) { // jump to the normal destination branch. BranchInst::Create(II->getNormalDest(), II); |