From b7922dee156105ef958c55ff2b64cd473035e0a0 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Thu, 5 Mar 2009 06:31:26 +0000 Subject: Do not split edges to EH landing pads. It will cause code size explosion. llvm-svn: 66140 --- llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'llvm/lib/Transforms') diff --git a/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp b/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp index 1f3a13cc9ce..85e57661c15 100644 --- a/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp +++ b/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp @@ -327,6 +327,12 @@ static void SplitEdgeNicely(TerminatorInst *TI, unsigned SuccNum, assert(isa(Dest->begin()) && "This should only be called if Dest has a PHI!"); + // Do not split edges to EH landing pads. + if (InvokeInst *Invoke = dyn_cast(TI)) { + if (Invoke->getSuccessor(1) == Dest) + return; + } + // As a hack, never split backedges of loops. Even though the copy for any // PHIs inserted on the backedge would be dead for exits from the loop, we // assume that the cost of *splitting* the backedge would be too high. -- cgit v1.2.3