<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 --- - Reporting of predicted benefits or vectorisation"
   href="https://llvm.org/bugs/show_bug.cgi?id=31691">31691</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Reporting of predicted benefits or vectorisation
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Linux
          </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>Loop Optimizer
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>drraph@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>When running the Intel Compiler with -qopt-report=4, say, you get told the
expected performance gain from vectorisation, amongst other useful information.
For example,

 LOOP BEGIN at permanent-in-c.c(47,7)
      remark #25045: Fused Loops: ( 47 50 )

      remark #15388: vectorization support: reference v has aligned access   [
permanent-in-c.c(48,2) ]
      remark #15388: vectorization support: reference v has aligned access   [
permanent-in-c.c(48,2) ]
      remark #15389: vectorization support: reference M has unaligned access  
[ permanent-in-c.c(48,2) ]
      remark #15388: vectorization support: reference v has aligned access   [
permanent-in-c.c(51,8) ]
      remark #15381: vectorization support: unaligned access used inside loop
body
      remark #15305: vectorization support: vector length 4
      remark #15399: vectorization support: unroll factor set to 2
      remark #15309: vectorization support: normalized vectorization overhead
0.600
      remark #15301: FUSED LOOP WAS VECTORIZED
      remark #15442: entire loop may be executed in remainder
      remark #15448: unmasked aligned unit stride loads: 1 
      remark #15449: unmasked aligned unit stride stores: 1 
      remark #15450: unmasked unaligned unit stride loads: 1 
      remark #15475: --- begin vector loop cost summary ---
      remark #15476: scalar loop cost: 49 
      remark #15477: vector loop cost: 10.000 
      remark #15478: estimated potential speedup: 4.580 
      remark #15487: type converts: 3 
      remark #15488: --- end vector loop cost summary ---
      remark #25456: Number of Array Refs Scalar Replaced In Loop: 2
   LOOP END

gcc also gives you similar if perhaps less useful information.  

[...]
vect_model_reduction_cost: inside_cost = 6, prologue_cost = 2, epilogue_cost =
6 .
test2.c:50:9: note: ==> examining statement: j_73 = j_186 + 1;
test2.c:50:9: note: irrelevant.
test2.c:50:9: note: ==> examining statement: if (j_73 < n.2_201)
test2.c:50:9: note: irrelevant.
test2.c:50:9: note: === vect_update_slp_costs_according_to_vf ===
test2.c:50:9: note: cost model: epilogue peel iters set to vf/2 because loop
iterations are unknown .
test2.c:50:9: note: Cost model analysis: 
  Vector inside of loop cost: 50
  Vector prologue cost: 8
  Vector epilogue cost: 52
  Scalar iteration cost: 20
  Scalar outside cost: 4
  Vector outside cost: 60
  prologue iterations: 0
  epilogue iterations: 2
  Calculated minimum iters for profitability: 5
test2.c:50:9: note:   Runtime profitability threshold = 4
test2.c:50:9: note:   Static estimate profitability threshold = 4
test2.c:50:9: note: epilog loop required

[...]


It would be great if clang/llvm could provide similar information to the
user/coder.</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>