<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 - Converting invoke to call does not transfer "MD_mem_parallel_loop_access" metadata"
   href="https://bugs.llvm.org/show_bug.cgi?id=39994">39994</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Converting invoke to call does not transfer "MD_mem_parallel_loop_access" metadata
          </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>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Transformation Utilities
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>moritz.kreutzer@siemens.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Hi,

We have observed a problem with vectorization and the newest LLVM/Clang trunk
(older versions seem to be affected as well). We have a loop with a potential
race condition for which we force vectorization using "#pragma clang loop
vectorize(assume_safety)." Despite that, Clang fails to vectorize our loop
reporting that it "cannot identify array bounds." After investigating the IR
after each pass, we found a potential cause of this issue. It seems like the
"MD_mem_parallel_loop_access" metadata did not get transferred over when
converting an invoke to a call. We could fix the problem by adding the
following line to the changeToCall() method in Local.cpp:

NewCall->copyMetadata(*II, LLVMContext::MD_mem_parallel_loop_access);

This is similar to to what is done in SROA, but we are not sure whether this is
a valid fix for the observed issue.

Please note that we are aware of the WIP under D52116 and D52117, but our fix
(with additional copying of "LLVMContext::MD_access_group" in the same call)
was also required to get the loop vectorized after applying those two patches.


Thanks,
Moritz</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>