Clarify llvm.clear_cache description.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204812 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Joerg Sonnenberger 2014-03-26 14:35:21 +00:00
parent 637e1da9e9
commit 25d0cfeb29

View File

@ -6952,32 +6952,25 @@ Syntax:
Overview: Overview:
""""""""" """""""""
The '``llvm.clear_cache``' intrinsic provides access to the systemcall The '``llvm.clear_cache``' intrinsic ensures visibility of modifications
that flushes the cache at the range specified. Some targets need this in the specified range to the execution unit of the processor. On
to specifically flush the instruction cache when executable data changes targets with non-unified instruction and data cache, the implementation
in memory (self-modifying code). Other targets have unified intruction flushes the instruction cache.
and data cache, so they don't need any calls.
Semantics: Semantics:
"""""""""" """"""""""
When directly supported, this intrinsic will either return a call to On platforms with coherent instruction and data caches (e.g. x86), this
the appropriate cache clearing system call (usually ``__clear_cache``) intrinsic is a nop. On platforms with non-coherent instruction and data
when the caches are not unified (ARM, Mips) or just remove the call cache (e.g. ARM, MIPS), the intrinsic is lowered either to appropiate
altogether when they are (ex. x86_64). Some targets can lower these instructions or a system call, if cache flushing requires special
directly into special instructions, if they have it. privileges.
The default behaviour is to emit a call to ``__clear_cache``, so in The default behavior is to emit a call to ``__clear_cache'' from the run
case a target doesn't support it, the user gets a linker error rather time library.
than a compiler internal error. It also provides a work around to
the user (implement an empty function called ``__clear_cache``) while
LLVM doesn't implement it in the target's back-end.
Please note that the caller is responsible for ensuring the cache This instrinsic does *not* empty the instruction pipeline. Modifications
is actually cleared. This is most important in targets that don't of the current function are outside the scope of the intrinsic.
need to flush the cache directly (ex. x86_64) and could potentially
still execute old instructions while the cache is not cleared. LLVM
will *not* insert nops or busy-wait sequences.
Standard C Library Intrinsics Standard C Library Intrinsics
----------------------------- -----------------------------