Title: [231154] trunk/Source/_javascript_Core
Revision
231154
Author
fpi...@apple.com
Date
2018-04-29 16:41:55 -0700 (Sun, 29 Apr 2018)

Log Message

B3 should run tail duplication at the bitter end
https://bugs.webkit.org/show_bug.cgi?id=185123

Reviewed by Geoffrey Garen.
        
Also added an option to disable taildup. This appears to be a 1% AsmBench speed-up. It's neutral
everywhere else.
        
The goal of this change is to allow us to run path specialization after switch lowering but
before tail duplication.

* b3/B3Generate.cpp:
(JSC::B3::generateToAir):
* runtime/Options.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (231153 => 231154)


--- trunk/Source/_javascript_Core/ChangeLog	2018-04-29 17:30:35 UTC (rev 231153)
+++ trunk/Source/_javascript_Core/ChangeLog	2018-04-29 23:41:55 UTC (rev 231154)
@@ -1,3 +1,20 @@
+2018-04-29  Filip Pizlo  <fpi...@apple.com>
+
+        B3 should run tail duplication at the bitter end
+        https://bugs.webkit.org/show_bug.cgi?id=185123
+
+        Reviewed by Geoffrey Garen.
+        
+        Also added an option to disable taildup. This appears to be a 1% AsmBench speed-up. It's neutral
+        everywhere else.
+        
+        The goal of this change is to allow us to run path specialization after switch lowering but
+        before tail duplication.
+
+        * b3/B3Generate.cpp:
+        (JSC::B3::generateToAir):
+        * runtime/Options.h:
+
 2018-04-29  Commit Queue  <commit-qu...@webkit.org>
 
         Unreviewed, rolling out r231137.

Modified: trunk/Source/_javascript_Core/b3/B3Generate.cpp (231153 => 231154)


--- trunk/Source/_javascript_Core/b3/B3Generate.cpp	2018-04-29 17:30:35 UTC (rev 231153)
+++ trunk/Source/_javascript_Core/b3/B3Generate.cpp	2018-04-29 23:41:55 UTC (rev 231154)
@@ -80,7 +80,7 @@
     
     if (shouldValidateIR())
         validate(procedure);
-
+    
     if (procedure.optLevel() >= 2) {
         reduceDoubleToFloat(procedure);
         reduceStrength(procedure);
@@ -87,12 +87,7 @@
         hoistLoopInvariantValues(procedure);
         if (eliminateCommonSubexpressions(procedure))
             eliminateCommonSubexpressions(procedure);
-        foldPathConstants(procedure);
-        reduceStrength(procedure);
         inferSwitches(procedure);
-        duplicateTails(procedure);
-        fixSSA(procedure);
-        foldPathConstants(procedure);
         
         // FIXME: Add more optimizations here.
         // https://bugs.webkit.org/show_bug.cgi?id=150507
@@ -106,6 +101,11 @@
 
     if (procedure.optLevel() >= 2) {
         reduceStrength(procedure);
+        if (Options::useB3TailDup())
+            duplicateTails(procedure);
+        fixSSA(procedure);
+        foldPathConstants(procedure);
+        reduceStrength(procedure);
 
         // FIXME: Add more optimizations here.
         // https://bugs.webkit.org/show_bug.cgi?id=150507

Modified: trunk/Source/_javascript_Core/runtime/Options.h (231153 => 231154)


--- trunk/Source/_javascript_Core/runtime/Options.h	2018-04-29 17:30:35 UTC (rev 231153)
+++ trunk/Source/_javascript_Core/runtime/Options.h	2018-04-29 23:41:55 UTC (rev 231154)
@@ -437,6 +437,7 @@
     v(bool, airRandomizeRegs, false, Normal, nullptr) \
     v(bool, coalesceSpillSlots, true, Normal, nullptr) \
     v(bool, logAirRegisterPressure, false, Normal, nullptr) \
+    v(bool, useB3TailDup, true, Normal, nullptr) \
     v(unsigned, maxB3TailDupBlockSize, 3, Normal, nullptr) \
     v(unsigned, maxB3TailDupBlockSuccessors, 3, Normal, nullptr) \
     \
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to