summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/WinEHPrepare.cpp
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2015-04-06 18:50:38 +0000
committerReid Kleckner <reid@kleckner.net>2015-04-06 18:50:38 +0000
commitb401941f3d82919e58fa1b990f9d05128d03a7b7 (patch)
tree2e198ed92aa72e792604ab3880792ca7e930113d /llvm/lib/CodeGen/WinEHPrepare.cpp
parent42335572bb32533c88a9f26b8a04995cd2000503 (diff)
downloadbcm5719-llvm-b401941f3d82919e58fa1b990f9d05128d03a7b7.tar.gz
bcm5719-llvm-b401941f3d82919e58fa1b990f9d05128d03a7b7.zip
[WinEH] Don't sink allocas into child handlers
The uselist isn't enough to infer anything about the lifetime of such allocas. If we want to re-add this optimization, we will need to leverage lifetime markers to do it. Fixes PR23122. llvm-svn: 234196
Diffstat (limited to 'llvm/lib/CodeGen/WinEHPrepare.cpp')
-rw-r--r--llvm/lib/CodeGen/WinEHPrepare.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/llvm/lib/CodeGen/WinEHPrepare.cpp b/llvm/lib/CodeGen/WinEHPrepare.cpp
index 9ebe8a2fc10..ab4f5cde030 100644
--- a/llvm/lib/CodeGen/WinEHPrepare.cpp
+++ b/llvm/lib/CodeGen/WinEHPrepare.cpp
@@ -561,17 +561,9 @@ bool WinEHPrepare::prepareExceptionHandlers(
}
}
- // If the parent alloca is used by exactly one handler and is not a catch
- // parameter, erase the parent and leave the copy in the outlined handler.
- // Catch parameters are indicated by a single null pointer in Allocas.
- if (ParentAlloca->getNumUses() == 0 && Allocas.size() == 1 &&
- Allocas[0] != getCatchObjectSentinel()) {
- ParentAlloca->eraseFromParent();
- // FIXME: Put a null entry in the llvm.frameescape call because we've
- // already created llvm.eh.actions calls with indices into it.
- AllocasToEscape.push_back(Constant::getNullValue(Int8PtrType));
- continue;
- }
+ // FIXME: We should try to sink unescaped allocas from the parent frame into
+ // the child frame. If the alloca is escaped, we have to use the lifetime
+ // markers to ensure that the alloca is only live within the child frame.
// Add this alloca to the list of things to escape.
AllocasToEscape.push_back(ParentAlloca);
OpenPOWER on IntegriCloud