<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - SciMark performance regression since r246985"
   href="https://llvm.org/bugs/show_bug.cgi?id=25321">25321</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>SciMark performance regression since r246985
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>yaron.keren@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dschuff@google.com, jfb@google.com, llvm-bugs@lists.llvm.org, rjmccall@apple.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>SciMark2 MonteCarlo performance had regressed to less than half in r246985.

To reproduce, download <a href="http://math.nist.gov/scimark2/scimark2_1c.zip">http://math.nist.gov/scimark2/scimark2_1c.zip</a> and open
it somewhere. Compile and run the benchmark with
<span class="quote">>clang -o scimark2 -O2 *.c
>./scimark2</span >
and look at the MonteCarlo results.

Comparing gcc 5.1, clang r246984, clang r246985 and r251299 (current svn),
gcc 5.1 and clang r246984 MonteCarlo performance are similar, although gcc
takes the lead.
clang r246985 performance was cut to less than half and stayed the same in
current svn. This may be a result of the code generated to access
Random_struct, when 17 is changed into 18 

typedef struct
{
  int m[17];                        
  int seed;                             
  int i;                                /* originally = 4 */ 

with

typedef struct
{
  int m[18];                        
  int seed;                             
  int i;                                /* originally = 4 */ 

the performance regression is gone.

<span class="quote">>uname -a</span >
Linux PC 3.16.0-51-generic #69~14.04.1-Ubuntu SMP Wed Oct 7 15:32:41 UTC 2015
x86_64 x86_64 x86_64 GNU/Linux

<span class="quote">>~/bug$ gcc -v  2>&1 | grep version</span >
gcc version 5.1.0 (Ubuntu 5.1.0-0ubuntu11~14.04.1)
<span class="quote">>~/bug$ gcc -O2 scimark2/*.c -o scimark -lm</span >
./scimark | grep MonteCarlo
<span class="quote">>~/bug$ ./scimark | grep MonteCarlo</span >
MonteCarlo:     Mflops:   672.76

<span class="quote">>~/bug$ llvm/bin/clang -v  2>&1 | grep version</span >
llvmclang version 3.8.0 (trunk 246984)
<span class="quote">>~/bug$ llvm/bin/clang -O2 scimark2/*.c -o scimark -lm</span >
./scimark | grep MonteCarlo
<span class="quote">>~/bug$ ./scimark | grep MonteCarlo</span >
MonteCarlo:     Mflops:   631.23

<span class="quote">>~/bug$ llvm/fast/bin/clang -v  2>&1 | grep version</span >
llvm/fast/bin/clang clang version 3.8.0 (trunk 246985)
<span class="quote">>~/bug$ llvm/fast/bin/clang -O2 scimark2/*.c -o scimark -lm</span >
./scimark | grep MonteCarlo
<span class="quote">>~/bug$ ./scimark | grep MonteCarlo</span >
MonteCarlo:     Mflops:   270.40

<span class="quote">>~/bug$ llvm/fast/bin/clang -v  2>&1 | grep version</span >
llvm/fast/bin/clang -O2 scimark2/*.c -o scimark -lm
clang version 3.8.0 (trunk 251299)
.>~/bug$ llvm/fast/bin/clang -O2 scimark2/*.c -o scimark -lm
cimark | grep MonteCarlo
<span class="quote">>~/bug$ ./scimark | grep MonteCarlo</span >
MonteCarlo:     Mflops:   266.42</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>