<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000'>Hi Chris,<br><br>Thanks! Can you (or someone else) revert this. I won't be able to look at it until tonight.<br><br> -Hal<br><br><hr id="zwchr"><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px; color: rgb(0, 0, 0); font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><b>From: </b>"Chris Matthews" <chris.matthews@apple.com><br><b>To: </b>"Hal Finkel" <hfinkel@anl.gov>, cfe-commits@lists.llvm.org<br><b>Sent: </b>Tuesday, October 11, 2016 2:32:33 PM<br><b>Subject: </b>Re: r283685 - When optimizing for size, enable loop rerolling by default<br><br>
<style>body{font-family:Helvetica,Arial;font-size:13px}</style><div id="bloop_customfont" style="font-family: Helvetica,Arial; font-size: 13px; margin: 0px;"><br></div><div id="bloop_customfont" style="font-family: Helvetica,Arial; font-size: 13px; margin: 0px;"><p style="font-family: 'helvetica Neue',helvetica; font-size: 14px;">I noticed since this commit there is a test-suite failure:</p><p style="margin: 0px; line-height: normal; font-family: Helvetica;"><br></p><p style="font-family: 'helvetica Neue',helvetica; font-size: 14px;"><a href="http://lab.llvm.org:8080/green/job/perf_darwin_x86_Osflto/64/" target="_blank">http://lab.llvm.org:8080/green/job/perf_darwin_x86_Osflto/64/</a></p><p style="margin: 0px; line-height: normal; font-family: Helvetica;"><br></p><p style="font-family: 'helvetica Neue',helvetica; font-size: 14px;">SingleSource.Benchmarks.Adobe-C++.loop_unroll appears to be failing.</p><p style="margin: 0px; line-height: normal; font-family: Helvetica;"><br></p><p style="font-family: 'helvetica Neue',helvetica; font-size: 14px;">Tailing the output of the program gets:</p><p style="margin: 0px; line-height: normal; font-family: Helvetica;"><br></p><p style="font-family: 'helvetica Neue',helvetica; font-size: 14px;">…</p><p style="font-family: 'helvetica Neue',helvetica; font-size: 14px;">test 236 failed</p><p style="font-family: 'helvetica Neue',helvetica; font-size: 14px;">test 236 failed</p><p style="font-family: 'helvetica Neue',helvetica; font-size: 14px;">test 236 failed</p><p style="font-family: 'helvetica Neue',helvetica; font-size: 14px;">test 236 failed</p><p style="font-family: 'helvetica Neue',helvetica; font-size: 14px;">test 236 failed</p><p style="font-family: 'helvetica Neue',helvetica; font-size: 14px;">test 236 failed</p><p style="font-family: 'helvetica Neue',helvetica; font-size: 14px;">test 236 failed</p></div> <br> <div id="bloop_sign_1476214348332995840" class="bloop_sign"></div> <br><p class="airmail_on">On October 8, 2016 at 8:15:40 PM, Hal Finkel via cfe-commits (<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>) wrote:</p> <blockquote class="clean_bq"><span><div><div></div><div>Author: hfinkel<br>Date: Sat Oct  8 22:06:31 2016<br>New Revision: 283685<br><br>URL: http://llvm.org/viewvc/llvm-project?rev=283685&view=rev<br>Log:<br>When optimizing for size, enable loop rerolling by default<br><br>We have a loop-rerolling optimization which can be enabled by using<br>-freroll-loops. While sometimes loops are hand-unrolled for performance<br>reasons, when optimizing for size, we should always undo this manual<br>optimization to produce smaller code (our optimizer's unroller will still<br>unroll the rerolled loops if it thinks that is a good idea).<br><br>Modified:<br>    cfe/trunk/lib/Driver/Tools.cpp<br>    cfe/trunk/test/Driver/clang_f_opts.c<br><br>Modified: cfe/trunk/lib/Driver/Tools.cpp<br>URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=283685&r1=283684&r2=283685&view=diff<br>==============================================================================<br>--- cfe/trunk/lib/Driver/Tools.cpp (original)<br>+++ cfe/trunk/lib/Driver/Tools.cpp Sat Oct  8 22:06:31 2016<br>@@ -5227,9 +5227,18 @@ void Clang::ConstructJob(Compilation &C,<br>   }<br> <br>   if (Arg *A = Args.getLastArg(options::OPT_freroll_loops,<br>-                               options::OPT_fno_reroll_loops))<br>+                               options::OPT_fno_reroll_loops)) {<br>     if (A->getOption().matches(options::OPT_freroll_loops))<br>       CmdArgs.push_back("-freroll-loops");<br>+  } else if (Arg *A = Args.getLastArg(options::OPT_O_Group)) {<br>+    // If rerolling is not explicitly enabled or disabled, then enable when<br>+    // optimizing for size.<br>+    if (A->getOption().matches(options::OPT_O)) {<br>+      StringRef S(A->getValue());<br>+      if (S == "s" || S == "z")<br>+        CmdArgs.push_back("-freroll-loops");<br>+    }<br>+  }<br> <br>   Args.AddLastArg(CmdArgs, options::OPT_fwritable_strings);<br>   Args.AddLastArg(CmdArgs, options::OPT_funroll_loops,<br><br>Modified: cfe/trunk/test/Driver/clang_f_opts.c<br>URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/clang_f_opts.c?rev=283685&r1=283684&r2=283685&view=diff<br>==============================================================================<br>--- cfe/trunk/test/Driver/clang_f_opts.c (original)<br>+++ cfe/trunk/test/Driver/clang_f_opts.c Sat Oct  8 22:06:31 2016<br>@@ -47,7 +47,12 @@<br> // CHECK-NO-UNROLL-LOOPS: "-fno-unroll-loops"<br> <br> // RUN: %clang -### -S -freroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-REROLL-LOOPS %s<br>+// RUN: %clang -### -S -Os %s 2>&1 | FileCheck -check-prefix=CHECK-REROLL-LOOPS %s<br>+// RUN: %clang -### -S -Oz %s 2>&1 | FileCheck -check-prefix=CHECK-REROLL-LOOPS %s<br> // RUN: %clang -### -S -fno-reroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-NO-REROLL-LOOPS %s<br>+// RUN: %clang -### -S -Os -fno-reroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-NO-REROLL-LOOPS %s<br>+// RUN: %clang -### -S -Oz -fno-reroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-NO-REROLL-LOOPS %s<br>+// RUN: %clang -### -S -O1 %s 2>&1 | FileCheck -check-prefix=CHECK-NO-REROLL-LOOPS %s<br> // RUN: %clang -### -S -fno-reroll-loops -freroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-REROLL-LOOPS %s<br> // RUN: %clang -### -S -freroll-loops -fno-reroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-NO-REROLL-LOOPS %s<br> // CHECK-REROLL-LOOPS: "-freroll-loops"<br><br><br>_______________________________________________<br>cfe-commits mailing list<br>cfe-commits@lists.llvm.org<br>http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits<br></div></div></span></blockquote></blockquote><br><br><br>-- <br><div><span name="x"></span>Hal Finkel<br>Lead, Compiler Technology and Programming Languages<br>Leadership Computing Facility<br>Argonne National Laboratory<span name="x"></span><br></div></div></body></html>