<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hi Aditya,</p>
    <p>My name is Gabor Ballabas, I work at the University of Szeged,
      Hungary.<br>
    </p>
    <p>We are running a code-size change benchmark system at <a
        href="www.csibe.org">www.csibe.org</a></p>
    I'd like to share with you - and with the community - the code-size
    change<br>
    results in our benchmark system after your patch landed.<br>
    We run this benchmarks after every commit in LLVM.<br>
    <p>Your patch resulted in the following improvements in code size:</p>
    * Target: x86_64, -Oz: -0.136%<br>
    * Target: ARM, Cortex-M0, -Oz: -0.061%<br>
    * Target: ARM, Cortex-M4, -Oz: -0.211%<br>
    <br>
    You can check the charts here: <a
      href="http://szeged.github.io/csibe/compiler-monitor.html">http://szeged.github.io/csibe/compiler-monitor.html</a><br>
    <br>
    I hope you will find this feedback useful.<br>
    <br>
    Best regards,<br>
    Gabor Ballabas<br>
    <p><a href="www.csibe.org"><br>
      </a></p>
    <p><a href="www.csibe.org"><br>
      </a></p>
    <div class="moz-cite-prefix">On 11/29/2016 03:34 PM, Aditya Kumar
      via llvm-commits wrote:<br>
    </div>
    <blockquote cite="mid:20161129143402.5F5602A6C076@llvm.org"
      type="cite">
      <pre wrap="">Author: hiraditya
Date: Tue Nov 29 08:34:01 2016
New Revision: 288141

URL: <a class="moz-txt-link-freetext" href="http://llvm.org/viewvc/llvm-project?rev=288141&view=rev">http://llvm.org/viewvc/llvm-project?rev=288141&view=rev</a>
Log:
[GVNHoist] Enable aggressive hoisting when optimizing for code-size

Enable scalar hoisting at -Oz as it is safe to hoist scalars to a place
where they are partially needed.

Differential Revision: <a class="moz-txt-link-freetext" href="https://reviews.llvm.org/D27111">https://reviews.llvm.org/D27111</a>

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

Modified: llvm/trunk/lib/Transforms/Scalar/GVNHoist.cpp
URL: <a class="moz-txt-link-freetext" href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVNHoist.cpp?rev=288141&r1=288140&r2=288141&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVNHoist.cpp?rev=288141&r1=288140&r2=288141&view=diff</a>
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/GVNHoist.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/GVNHoist.cpp Tue Nov 29 08:34:01 2016
@@ -202,7 +202,12 @@ public:
   GVNHoist(DominatorTree *DT, AliasAnalysis *AA, MemoryDependenceResults *MD,
            MemorySSA *MSSA, bool OptForMinSize)
       : DT(DT), AA(AA), MD(MD), MSSA(MSSA), OptForMinSize(OptForMinSize),
-        HoistingGeps(OptForMinSize), HoistedCtr(0) {}
+        HoistingGeps(OptForMinSize), HoistedCtr(0) {
+      // Hoist as far as possible when optimizing for code-size.
+      if (OptForMinSize)
+        MaxNumberOfBBSInPath = -1;
+  }
+
   bool run(Function &F) {
     VN.setDomTree(DT);
     VN.setAliasAnalysis(AA);
@@ -500,10 +505,13 @@ private:
   bool safeToHoistScalar(const BasicBlock *HoistBB,
                          SmallPtrSetImpl<const BasicBlock *> &WL,
                          int &NBBsOnAllPaths) {
-    // Check that the hoisted expression is needed on all paths.  Enable scalar
-    // hoisting at -Oz as it is safe to hoist scalars to a place where they are
-    // partially needed.
-    if (!OptForMinSize && !hoistingFromAllPaths(HoistBB, WL))
+    // Enable scalar hoisting at -Oz as it is safe to hoist scalars to a place
+    // where they are partially needed.
+    if (OptForMinSize)
+      return true;
+
+    // Check that the hoisted expression is needed on all paths.
+    if (!hoistingFromAllPaths(HoistBB, WL))
       return false;
 
     for (const BasicBlock *BB : WL)


_______________________________________________
llvm-commits mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>