diff options
author | Chris Lattner <sabre@nondot.org> | 2008-05-09 15:07:33 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-05-09 15:07:33 +0000 |
commit | cb19a1cc5d427ddf35ea7df4b31d311a680c88b0 (patch) | |
tree | 44c03633782e871adf7209436c34f145535b374c | |
parent | 8573b004e18a9054ba57c01d66fb5b83f48c4a97 (diff) | |
download | external_llvm-cb19a1cc5d427ddf35ea7df4b31d311a680c88b0.zip external_llvm-cb19a1cc5d427ddf35ea7df4b31d311a680c88b0.tar.gz external_llvm-cb19a1cc5d427ddf35ea7df4b31d311a680c88b0.tar.bz2 |
don't sink invokes, even if they are readonly. This fixes a
crash on kimwitu++.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50901 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index e8b60f8..f359187 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/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() == |