summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2011-09-27 22:14:12 +0000
committerBill Wendling <isanbard@gmail.com>2011-09-27 22:14:12 +0000
commit354ff9e348d9b67142d818b7bcf720738bd39311 (patch)
treeda5bdc2fb85b3b89d00a32e9b6cc381f48375ef8 /llvm/lib/CodeGen
parentddbd68fbd27836b1d59d7a8bfc9706675a77647e (diff)
downloadbcm5719-llvm-354ff9e348d9b67142d818b7bcf720738bd39311.tar.gz
bcm5719-llvm-354ff9e348d9b67142d818b7bcf720738bd39311.zip
This is the start of the new SjLj EH preparation pass, which will replace the
current IR-level pass. The old SjLj EH pass has some problems, especially with the new EH model. Most significantly, it violates some of the new restrictions the new model has. For instance, the 'dispatch' table wants to jump to the landing pad, but we cannot allow that because only an invoke's unwind edge can jump to a landing pad. This requires us to mangle the code something awful. In addition, we need to keep the now dead landingpad instructions around instead of CSE'ing them because the DWARF emitter uses that information (they are dead because no control flow edge will execute them - the control flow edge from an invoke's unwind is superceded by the edge coming from the dispatch). Basically, this pass belongs not at the IR level where SSA is king, but at the code-gen level, where we have more flexibility. llvm-svn: 140646
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/LLVMTargetMachine.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LLVMTargetMachine.cpp b/llvm/lib/CodeGen/LLVMTargetMachine.cpp
index 8f463e2d3f9..9196816b351 100644
--- a/llvm/lib/CodeGen/LLVMTargetMachine.cpp
+++ b/llvm/lib/CodeGen/LLVMTargetMachine.cpp
@@ -45,6 +45,9 @@ namespace llvm {
bool EnableFastISel;
}
+static cl::opt<bool> DisableOldSjLjEH("disable-old-sjlj-eh", cl::Hidden,
+ cl::desc("Disable the old SjLj EH preparation pass"));
+
static cl::opt<bool> DisablePostRA("disable-post-ra", cl::Hidden,
cl::desc("Disable Post Regalloc"));
static cl::opt<bool> DisableBranchFold("disable-branch-fold", cl::Hidden,
@@ -322,7 +325,8 @@ bool LLVMTargetMachine::addCommonCodeGenPasses(PassManagerBase &PM,
// removed from the parent invoke(s). This could happen when a landing
// pad is shared by multiple invokes and is also a target of a normal
// edge from elsewhere.
- PM.add(createSjLjEHPass(getTargetLowering()));
+ if (!DisableOldSjLjEH)
+ PM.add(createSjLjEHPass(getTargetLowering()));
// FALLTHROUGH
case ExceptionHandling::DwarfCFI:
case ExceptionHandling::ARM:
OpenPOWER on IntegriCloud