From a98d464fd6320c0eca1aefa7d9b6a55b0ba4a635 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 22 Jun 2003 20:46:00 +0000 Subject: [PATCH] Add paranoia checking llvm-svn: 6856 --- lib/Transforms/Scalar/TailDuplication.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Transforms/Scalar/TailDuplication.cpp b/lib/Transforms/Scalar/TailDuplication.cpp index 17237431a91..e736f970af5 100644 --- a/lib/Transforms/Scalar/TailDuplication.cpp +++ b/lib/Transforms/Scalar/TailDuplication.cpp @@ -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;