use splice instead of remove/insert to avoid some symtab operations
authorChris Lattner <sabre@nondot.org>
Wed, 3 Aug 2005 00:23:42 +0000 (00:23 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 3 Aug 2005 00:23:42 +0000 (00:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22611 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/SimplifyCFG.cpp

index 34b31bc6991269a7f857ee770784ce102d1afafd..3eaae8eacc530b26675e24cc61cd35e8ae029db9 100644 (file)
@@ -153,8 +153,8 @@ static bool TryToSimplifyUncondBranchFromEmptyBlock(BasicBlock *BB,
         // *ONLY* had BB as a predecessor, and the PHI node is still valid
         // now.  Simply move it into Succ, because we know that BB
         // strictly dominated Succ.
-        BB->getInstList().remove(BB->begin());
-        Succ->getInstList().push_front(PN);
+        Succ->getInstList().splice(Succ->begin(),
+                                   BB->getInstList(), BB->begin());
         
         // We need to add new entries for the PHI node to account for
         // predecessors of Succ that the PHI node does not take into