Work around a bug in LLVM by flipping the unification order
authorfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Dec 2015 19:10:55 +0000 (19:10 +0000)
committerfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Dec 2015 19:10:55 +0000 (19:10 +0000)
https://bugs.webkit.org/show_bug.cgi?id=152341
rdar://problem/23920749

Reviewed by Mark Lam.

* dfg/DFGUnificationPhase.cpp:
(JSC::DFG::UnificationPhase::run):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194164 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/dfg/DFGUnificationPhase.cpp

index c82af1b..b81a45c 100644 (file)
@@ -1,3 +1,14 @@
+2015-12-16  Filip Pizlo  <fpizlo@apple.com>
+
+        Work around a bug in LLVM by flipping the unification order
+        https://bugs.webkit.org/show_bug.cgi?id=152341
+        rdar://problem/23920749
+
+        Reviewed by Mark Lam.
+
+        * dfg/DFGUnificationPhase.cpp:
+        (JSC::DFG::UnificationPhase::run):
+
 2015-12-16  Saam barati  <sbarati@apple.com>
 
         Add "explicit operator bool" to ScratchRegisterAllocator::PreservedState
index d62cac5..d76606c 100644 (file)
@@ -59,8 +59,12 @@ public:
                 for (unsigned childIdx = 0; childIdx < AdjacencyList::Size; ++childIdx) {
                     if (!phi->children.child(childIdx))
                         break;
-                    
-                    phi->children.child(childIdx)->variableAccessData()->unify(phi->variableAccessData());
+
+                    // We'd like to reverse the order of unification because it helps to reveal
+                    // more bugs on our end, though it's otherwise not observable. But we do it
+                    // this way because it works around a bug in open source LLVM's live-outs
+                    // computation.
+                    phi->variableAccessData()->unify(phi->children.child(childIdx)->variableAccessData());
                 }
             }
         }