Also run foldPathConstants before mussing up SSA
https://bugs.webkit.org/show_bug.cgi?id=185069

Reviewed by Saam Barati.
        
This isn't needed now, but will be once I implement the phase in bug 185060.
        
This could be a speed-up, or a slow-down, independent of that phase. Most likely it's neutral.
Local testing seems to suggest that it's neutral. Anyway, whatever it ends up being, I want it to
be landed separately and measured separately from that phase.
        
It's probably nice for sanity to have this and reduceStrength run before tail duplication and
another round of reduceStrength, since that make for something that is closer to a fixpoint. But
it will increase FTL compile times. So, there's no way to guess if this change is good, bad, or
neutral. It all depends on what programs typically look like.

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



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@231116 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index 87ff7cb..8ca38cd 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,24 @@
+2018-04-26  Filip Pizlo  <fpizlo@apple.com>
+
+        Also run foldPathConstants before mussing up SSA
+        https://bugs.webkit.org/show_bug.cgi?id=185069
+
+        Reviewed by Saam Barati.
+        
+        This isn't needed now, but will be once I implement the phase in bug 185060.
+        
+        This could be a speed-up, or a slow-down, independent of that phase. Most likely it's neutral.
+        Local testing seems to suggest that it's neutral. Anyway, whatever it ends up being, I want it to
+        be landed separately and measured separately from that phase.
+        
+        It's probably nice for sanity to have this and reduceStrength run before tail duplication and
+        another round of reduceStrength, since that make for something that is closer to a fixpoint. But
+        it will increase FTL compile times. So, there's no way to guess if this change is good, bad, or
+        neutral. It all depends on what programs typically look like.
+
+        * b3/B3Generate.cpp:
+        (JSC::B3::generateToAir):
+
 2018-04-27  Ryan Haddad  <ryanhaddad@apple.com>
 
         Unreviewed, rolling out r231086.
diff --git a/Source/JavaScriptCore/b3/B3Generate.cpp b/Source/JavaScriptCore/b3/B3Generate.cpp
index 675b1e2..975ba66 100644
--- a/Source/JavaScriptCore/b3/B3Generate.cpp
+++ b/Source/JavaScriptCore/b3/B3Generate.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2018 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -87,6 +87,8 @@
         hoistLoopInvariantValues(procedure);
         if (eliminateCommonSubexpressions(procedure))
             eliminateCommonSubexpressions(procedure);
+        foldPathConstants(procedure);
+        reduceStrength(procedure);
         inferSwitches(procedure);
         duplicateTails(procedure);
         fixSSA(procedure);