<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 --- - Possible vectorization or CodeGen bug"
   href="https://llvm.org/bugs/show_bug.cgi?id=28135">28135</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Possible vectorization or CodeGen bug
          </td>
        </tr>

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

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

        <tr>
          <th>Hardware</th>
          <td>All
          </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>Loop Optimizer
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>pirama@google.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>Created <span class=""><a href="attachment.cgi?id=16545" name="attach_16545" title="Simplified function for possible vectorization bug">attachment 16545</a> <a href="attachment.cgi?id=16545&action=edit" title="Simplified function for possible vectorization bug">[details]</a></span>
Simplified function for possible vectorization bug

[Tentatively marking "loop optimization" component this repros in both AArch64
and ARM targets]

This relates to the Android issue mentioned in
<a href="https://android-review.googlesource.com/#/c/235875/">https://android-review.googlesource.com/#/c/235875/</a>.

The function 'loop' in the attached 'codec-loop.c' function produces incorrect
output when the 'for' loop in it is vectorized and called from that source file
(<a href="https://android-review.googlesource.com/#/c/235875/2/media/libstagefright/codecs/amrwbenc/src/voAMRWBEnc.c">https://android-review.googlesource.com/#/c/235875/2/media/libstagefright/codecs/amrwbenc/src/voAMRWBEnc.c</a>).
 The incorrect output causes corruption in the codec's output.

The failure reproduces on both AArch64 and ARM32.  Various workarounds fix the
failure (adding prints in the loop body, turning on integer sanitization etc)
but they all succeed only because vectorization and vector instructions don't
get used.

I am trying to find the right set of inputs that trigger the issue in the
reduced "loop" functiono.  I'll post it here if I am successful.

PS: I tested this on Android's Clang, which is a bit behind trunk.  However,
LLVM IR from both ToT and Android's clang was the same, except for very minor
differences).</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>