[llvm-commits] [llvm] r51573 - /llvm/trunk/lib/Transforms/Scalar/PredicateSimplifier.cpp

Nick Lewycky nicholas at mxc.ca
Mon May 26 17:59:06 PDT 2008


Author: nicholas
Date: Mon May 26 19:59:05 2008
New Revision: 51573

URL: http://llvm.org/viewvc/llvm-project?rev=51573&view=rev
Log:
InequalityGraph::node() can create new nodes, invalidating iterators across
the set of nodes. Fix makeEqual to handle this by creating the new node first
then iterating across them second.

Modified:
    llvm/trunk/lib/Transforms/Scalar/PredicateSimplifier.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/PredicateSimplifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/PredicateSimplifier.cpp?rev=51573&r1=51572&r2=51573&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/PredicateSimplifier.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/PredicateSimplifier.cpp Mon May 26 19:59:05 2008
@@ -1594,6 +1594,7 @@
       if (mergeIGNode) {
         // Create N1.
         if (!n1) n1 = VN.getOrInsertVN(V1, Top);
+        IG.node(n1); // Ensure that IG.Nodes won't get resized
 
         // Migrate relationships from removed nodes to N1.
         for (SetVector<unsigned>::iterator I = Remove.begin(), E = Remove.end();





More information about the llvm-commits mailing list