<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - FFT and Sparse matmult in Scimark2 are slower with -O2 & -O3 than -O1"
   href="https://bugs.llvm.org/show_bug.cgi?id=43576">43576</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>FFT and Sparse matmult in Scimark2 are slower with -O2 & -O3 than -O1
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>9.0
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>All
          </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>C
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>hehaochen13@nudt.edu.cn
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>FFT and Sparse matmult in
Scimark2(<a href="https://math.nist.gov/scimark2/download_c.html">https://math.nist.gov/scimark2/download_c.html</a>) are slower with -O2 &
-O3 than -O1.

In gcc-9.2.0, everything is OK.

All the experiments are carried out in CentOS 7.6.1810 (Core) 

╔════════════════════════════╤═════════════╤════════════════╤═══════════╗
║ make CC=clang-9/gcc \      │             │                │           ║
║ CFLAGS="-Ox -march=native” │  Mflops in  │    Comment     │ Mflops in ║
║                            │ clang-9.0.0 │                │ gcc-9.2.0 ║
║ ./scimark2                 │             │                │           ║
╠══════╤═════════════════════╪═════════════╪════════════════╪═══════════╣
║ -O0  │ Composite Score     │ 480.30      │                │ 435.11    ║
║      ├─────────────────────┼─────────────┼────────────────┼───────────╢
║      │ FFT                 │ 356.03      │                │ 326.45    ║
║      ├─────────────────────┼─────────────┼────────────────┼───────────╢
║      │ SOR                 │ 772.92      │                │ 768.71    ║
║      ├─────────────────────┼─────────────┼────────────────┼───────────╢
║      │ MonteCarlo          │ 77.57       │                │ 92.10     ║
║      ├─────────────────────┼─────────────┼────────────────┼───────────╢
║      │ Sparse matmult      │ 459.64      │                │ 419.38    ║
║      ├─────────────────────┼─────────────┼────────────────┼───────────╢
║      │ LU                  │ 735.37      │                │ 568.94    ║
╟──────┼─────────────────────┼─────────────┼────────────────┼───────────╢
║ -O1  │ Composite Score     │ 1494.63     │                │ 1451.81   ║
║      ├─────────────────────┼─────────────┼────────────────┼───────────╢
║      │ FFT                 │ 1430.49     │                │ 1400.51   ║
║      ├─────────────────────┼─────────────┼────────────────┼───────────╢
║      │ SOR                 │ 1117.54     │                │ 856.00    ║
║      ├─────────────────────┼─────────────┼────────────────┼───────────╢
║      │ MonteCarlo          │ 439.39      │                │ 523.79    ║
║      ├─────────────────────┼─────────────┼────────────────┼───────────╢
║      │ Sparse matmult      │ 2179.07     │                │ 2188.18   ║
║      ├─────────────────────┼─────────────┼────────────────┼───────────╢
║      │ LU                  │ 2306.67     │                │ 2290.57   ║
╟──────┼─────────────────────┼─────────────┼────────────────┼───────────╢
║ -O2  │ Composite Score     │ 1743.93     │                │ 1700.95   ║
║      ├─────────────────────┼─────────────┼────────────────┼───────────╢
║      │ FFT                 │ **1300.62** │ Slower than O1 │ 1618.03   ║
║      ├─────────────────────┼─────────────┼────────────────┼───────────╢
║      │ SOR                 │ 1123.46     │                │ 1067.22   ║
║      ├─────────────────────┼─────────────┼────────────────┼───────────╢
║      │ MonteCarlo          │ 440.73      │                │ 584.45    ║
║      ├─────────────────────┼─────────────┼────────────────┼───────────╢
║      │ Sparse matmult      │ **1771.17** │ Slower than O1 │ 2446.48   ║
║      ├─────────────────────┼─────────────┼────────────────┼───────────╢
║      │ LU                  │ 4083.67     │                │ 2788.59   ║
╟──────┼─────────────────────┼─────────────┼────────────────┼───────────╢
║ -O3  │ Composite Score     │ 1786.63     │                │ 2376.34   ║
║      ├─────────────────────┼─────────────┼────────────────┼───────────╢
║      │ FFT                 │ **1304.30** │ Slower than O1 │ 1700.11   ║
║      ├─────────────────────┼─────────────┼────────────────┼───────────╢
║      │ SOR                 │ 1128.26     │                │ 1540.28   ║
║      ├─────────────────────┼─────────────┼────────────────┼───────────╢
║      │ MonteCarlo          │ 439.83      │                │ 587.74    ║
║      ├─────────────────────┼─────────────┼────────────────┼───────────╢
║      │ Sparse matmult      │ **1896.98** │ Slower than O1 │ 2443.62   ║
║      ├─────────────────────┼─────────────┼────────────────┼───────────╢
║      │ LU                  │ 4163.75     │                │ 5609.94   ║
╚══════╧═════════════════════╧═════════════╧════════════════╧═══════════╝</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>