<html>
    <head>
      <base href="http://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 --- - Implement __builtin___clear_cache and lower to __clear_cache on ARM"
   href="http://llvm.org/bugs/show_bug.cgi?id=19142">19142</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Implement __builtin___clear_cache and lower to __clear_cache on ARM
          </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>Backend: ARM
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>renato.golin@linaro.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Android uses the GCC intrinsic __builtin___clear_cache described here:
<a href="http://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html">http://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html</a>

To implement that in LLVM we'd have to add it in three steps:

1. Add support for clang to recognise __builtin___clear_cache and lower to some
intrinsic like @llvm.clear_cache

2. Add a LibCall to __clear_cache, but set it as noop by default (some targets
don't need it), and set it to __clear_cache on the targets that do support it.

3. Link @llvm.clear_cache to LibCall's __clear_cache.

As an extra, on ARM, would it be desired to lower the call to a sequence of
instructions (push r7, mov r7, #0xf0002, svc 0x0, pop r7), or is that a bit too
much optimisation?</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>