<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 - AMDGPU backend doesn't support mempcpy builtin"
   href="https://bugs.llvm.org/show_bug.cgi?id=43180">43180</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>AMDGPU backend doesn't support mempcpy builtin
          </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>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>Backend: AMDGPU
          </td>
        </tr>

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

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

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=22455" name="attach_22455" title="7z archive containing the attachments">attachment 22455</a> <a href="attachment.cgi?id=22455&action=edit" title="7z archive containing the attachments">[details]</a></span>
7z archive containing the attachments

Very weirdly, it would seem that __builtin_mempcpy is not supported on amdgcn,
when __builtin_memcpy is.

When trying to compile a simple code file simply containing a wrapper function
calling these two functions (with -target amdgcn -mcpu=gfx909 (gfx909 so that
loads and stores work)), compiling a memcpy wrapper works, but compiling a
mempcpy wrapper crashes with "fatal error: error in backend: unsupported
libcall legalization"

I attached a 7z archive containing relevant files.

BTW was just trying to see the code generation for these builtins on multiple
platforms

Files in 7z archive :

- builtinMemcpy.c : code file containing a wrapper around __builtin_memcpy,
compiled with "clang -c builtinMemcpy.c -target amdgcn -mcpu=gfx909 -S"
- builtinMemcpy.s : result of the compilation of builtinMemcpy.c
- builtinMempcpy.c : code file containing a wrapper around __builtin_mempcpy
- builtinMempcpyPreprocessed.c : Preprocessed version of builtinMempcpy
provided by clang after crash
- builtinMempcpyRunScript.sh : Run script for builtinMempcpy provided by clang
after crash</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>