summaryrefslogtreecommitdiff
path: root/docs/LangRef.rst
diff options
context:
space:
mode:
authorRenato Golin <renato.golin@linaro.org>2014-03-26 14:01:32 +0000
committerRenato Golin <renato.golin@linaro.org>2014-03-26 14:01:32 +0000
commit58839f43de03c894c3398ba2f7429c3ba82c96c1 (patch)
tree87aaf33c8ea1753977004fca30253065b725feac /docs/LangRef.rst
parentcee1aecc57161f75c6d6af7c1f2ea6758bdd6b02 (diff)
downloadllvm-58839f43de03c894c3398ba2f7429c3ba82c96c1.tar.gz
llvm-58839f43de03c894c3398ba2f7429c3ba82c96c1.tar.bz2
llvm-58839f43de03c894c3398ba2f7429c3ba82c96c1.tar.xz
Change @llvm.clear_cache default to call rt-lib
After some discussion on IRC, emitting a call to the library function seems like a better default, since it will move from a compiler internal error to a linker error, that the user can work around until LLVM is fixed. I'm also adding a note on the responsibility of the user to confirm that the cache was cleared on platforms where nothing is done. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204806 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/LangRef.rst')
-rw-r--r--docs/LangRef.rst18
1 files changed, 14 insertions, 4 deletions
diff --git a/docs/LangRef.rst b/docs/LangRef.rst
index d18d4ebac9..1a6549a15d 100644
--- a/docs/LangRef.rst
+++ b/docs/LangRef.rst
@@ -6964,10 +6964,20 @@ Semantics:
When directly supported, this intrinsic will either return a call to
the appropriate cache clearing system call (usually ``__clear_cache``)
when the caches are not unified (ARM, Mips) or just remove the call
-altogether when they are (ex. x86_64).
-
-Targets must implement it directly to have either behaviour, as the
-default is to bail with "Not Implemented" message.
+altogether when they are (ex. x86_64). Some targets can lower these
+directly into special instructions, if they have it.
+
+The default behaviour is to emit a call to ``__clear_cache``, so in
+case a target doesn't support it, the user gets a linker error rather
+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
+is actually cleared. This is most important in targets that don't
+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
-----------------------------