summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-05-09 15:07:33 +0000
committerChris Lattner <sabre@nondot.org>2008-05-09 15:07:33 +0000
commita4ee1f516f5af3849672780d136559f8c9aea9b7 (patch)
tree203ef66ead58829e5eac6e3537e500175bacedad /llvm/lib/Transforms
parent437435dcbc5d5943ee6741096fc8666249f1cf71 (diff)
downloadbcm5719-llvm-a4ee1f516f5af3849672780d136559f8c9aea9b7.tar.gz
bcm5719-llvm-a4ee1f516f5af3849672780d136559f8c9aea9b7.zip
don't sink invokes, even if they are readonly. This fixes a
crash on kimwitu++. llvm-svn: 50901
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index e8b60f890c2..f3591879f7b 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -11233,7 +11233,8 @@ static bool TryToSinkInstruction(Instruction *I, BasicBlock *DestBlock) {
assert(I->hasOneUse() && "Invariants didn't hold!");
// Cannot move control-flow-involving, volatile loads, vaarg, etc.
- if (isa<PHINode>(I) || I->mayWriteToMemory()) return false;
+ if (isa<PHINode>(I) || I->mayWriteToMemory() || isa<TerminatorInst>(I))
+ return false;
// Do not sink alloca instructions out of the entry block.
if (isa<AllocaInst>(I) && I->getParent() ==
OpenPOWER on IntegriCloud