[LLVMdev] A quick update on FreeBSD support

Bill Wendling isanbard at gmail.com
Sun May 25 00:58:24 PDT 2008


On May 24, 2008, at 4:25 PM, Marcel Moolenaar wrote:

> On May 24, 2008, at 12:12 PM, Bill Wendling wrote:
>
>> Let us know if you would like extra eyes on the two PPC failures.  
>> Many
>> of us have a lot of experience with C++. :-) Do you know where these
>> allocations are?
>
> I don't mind if people help out, so here's some information:
>
Could you try this (massively hacky) patch out to see if it fixes your  
problem?

-bw

Index: lib/Transforms/Scalar/PredicateSimplifier.cpp
===================================================================
--- lib/Transforms/Scalar/PredicateSimplifier.cpp	(revision 51554)
+++ lib/Transforms/Scalar/PredicateSimplifier.cpp	(working copy)
@@ -674,6 +674,15 @@
        const_iterator begin() const { return Relations.begin(); }
        const_iterator end()   const { return Relations.end();   }

+      Edge &operator[](unsigned Idx) {
+        return Relations[Idx];
+      }
+      const Edge &operator[](unsigned Idx) const {
+        return Relations[Idx];
+      }
+
+      size_t size() const { return Relations.size(); }
+
        iterator find(unsigned n, DomTreeDFS::Node *Subtree) {
          iterator E = end();
          for (iterator I = std::lower_bound(begin(), E, n);
@@ -1599,18 +1608,23 @@
          for (SetVector<unsigned>::iterator I = Remove.begin(), E =  
Remove.end();
               I != E; ++I) {
            unsigned n = *I;
-          for (Node::iterator NI = IG.node(n)->begin(), NE =  
IG.node(n)->end();
-               NI != NE; ++NI) {
-            if (NI->Subtree->DominatedBy(Top)) {
-              if (NI->To == n1) {
-                assert((NI->LV & EQ_BIT) && "Node inequal to itself.");
+          Node *N = IG.node(n);
+          for (unsigned Size = N->size(), i = 0; i < Size; ++i) {
+            InequalityGraph::Edge *E = &(*N)[i];
+            if (E->Subtree->DominatedBy(Top)) {
+              if (E->To == n1) {
+                assert((E->LV & EQ_BIT) && "Node inequal to itself.");
                  continue;
                }
-              if (Remove.count(NI->To))
+              if (Remove.count(E->To))
                  continue;

-              IG.node(NI->To)->update(n1, reversePredicate(NI->LV),  
Top);
-              IG.node(n1)->update(NI->To, NI->LV, Top);
+              IG.node(E->To)->update(n1, reversePredicate(E->LV), Top);
+              E = &(*N)[i];
+              Size = N->size();
+              IG.node(n1)->update(E->To, E->LV, Top);
+              E = &(*N)[i];
+              Size = N->size();
              }
            }
          }





More information about the llvm-dev mailing list