From be11db68943873256b01340ff364c784c066f6b3 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 10 Nov 2009 01:19:06 +0000 Subject: don't invalidate PN, rewrite of this code is in progress anyway. llvm-svn: 86639 --- llvm/lib/Transforms/Scalar/JumpThreading.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Transforms') diff --git a/llvm/lib/Transforms/Scalar/JumpThreading.cpp b/llvm/lib/Transforms/Scalar/JumpThreading.cpp index 46d40ef5d15..7a7f407b96b 100644 --- a/llvm/lib/Transforms/Scalar/JumpThreading.cpp +++ b/llvm/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); -- cgit v1.2.3