Add paranoia checking
authorChris Lattner <sabre@nondot.org>
Sun, 22 Jun 2003 20:46:00 +0000 (20:46 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 22 Jun 2003 20:46:00 +0000 (20:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6856 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/TailDuplication.cpp

index 17237431a91088253ff9a1734658c85341d2edb9..e736f970af5ee0ea50a8df06287fa3d282639f2a 100644 (file)
@@ -303,7 +303,7 @@ Value *TailDup::GetValueInBlock(BasicBlock *BB, Value *OrigVal,
     }
 
   // Found a value to replace the PHI node with?
-  if (ReplVal) {
+  if (ReplVal && ReplVal != PN) {
     PN->replaceAllUsesWith(ReplVal);
     BBVal = ReplVal;
     if (BBOutVal == PN) BBOutVal = ReplVal;