From: Chris Lattner Date: Sun, 22 Jun 2003 20:46:00 +0000 (+0000) Subject: Add paranoia checking X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=066ab6ac80ae93af64857c5822efc81298eaca32;p=oota-llvm.git Add paranoia checking git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6856 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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;