summaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/JumpThreading.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-11-10 01:19:06 +0000
committerChris Lattner <sabre@nondot.org>2009-11-10 01:19:06 +0000
commite7c90967b17286b0e8fe21fcbfb9cf898b6e7a96 (patch)
tree4cfd69123a0e21fb7fcd87d81ba062bb862c9cb2 /lib/Transforms/Scalar/JumpThreading.cpp
parente34537856a544c83513e390ac9552a8bc3823346 (diff)
downloadllvm-e7c90967b17286b0e8fe21fcbfb9cf898b6e7a96.tar.gz
llvm-e7c90967b17286b0e8fe21fcbfb9cf898b6e7a96.tar.bz2
llvm-e7c90967b17286b0e8fe21fcbfb9cf898b6e7a96.tar.xz
don't invalidate PN, rewrite of this code is in progress anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86639 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/JumpThreading.cpp')
-rw-r--r--lib/Transforms/Scalar/JumpThreading.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Transforms/Scalar/JumpThreading.cpp b/lib/Transforms/Scalar/JumpThreading.cpp
index 46d40ef5d1..7a7f407b96 100644
--- a/lib/Transforms/Scalar/JumpThreading.cpp
+++ b/lib/Transforms/Scalar/JumpThreading.cpp
@@ -223,10 +223,11 @@ static void RemovePredecessorAndSimplify(BasicBlock *BB, BasicBlock *Pred,
U = PNV;
// See if we can simplify it.
- if (Value *V = SimplifyInstruction(User, TD)) {
- User->replaceAllUsesWith(V);
- User->eraseFromParent();
- }
+ if (User != PN)
+ if (Value *V = SimplifyInstruction(User, TD)) {
+ User->replaceAllUsesWith(V);
+ User->eraseFromParent();
+ }
}
PN->replaceAllUsesWith(PNV);