Nick Lewycky pointed out that this code makes changes unconditionally.
authorDan Gohman <gohman@apple.com>
Tue, 5 Jan 2010 17:50:58 +0000 (17:50 +0000)
committerDan Gohman <gohman@apple.com>
Tue, 5 Jan 2010 17:50:58 +0000 (17:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92739 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/Local.cpp

index 30fe8025135092f437c258089f31d9d31448349d..1a7d27ad45c75455a7d8662a35b0cec94b3abafd 100644 (file)
@@ -328,7 +328,8 @@ llvm::RecursivelyDeleteDeadPHINode(PHINode *PN) {
       if (!PHIs.insert(cast<PHINode>(JP))) {
         // Break the cycle and delete the PHI and its operands.
         JP->replaceAllUsesWith(UndefValue::get(JP->getType()));
-        Changed |= RecursivelyDeleteTriviallyDeadInstructions(JP);
+        (void)RecursivelyDeleteTriviallyDeadInstructions(JP);
+        Changed = true;
         break;
       }
   return Changed;