Change @llvm.clear_cache default to call rt-lib
[oota-llvm.git] / docs / LangRef.rst
index 0a46e8375e2c87165afe95b866eecdc9a62fb40c..1a6549a15d67b6d4ace9734878640146396eb257 100644 (file)
@@ -197,16 +197,6 @@ linkage:
     private to be renamed as necessary to avoid collisions. Because the
     symbol is private to the module, all references can be updated. This
     doesn't show up in any symbol table in the object file.
-``linker_private``
-    Similar to ``private``, but the symbol is passed through the
-    assembler and evaluated by the linker. Unlike normal strong symbols,
-    they are removed by the linker from the final linked image
-    (executable or dynamic library).
-``linker_private_weak``
-    Similar to "``linker_private``", but the symbol is weak. Note that
-    ``linker_private_weak`` symbols are subject to coalescing by the
-    linker. The symbols are removed by the linker from the final linked
-    image (executable or dynamic library).
 ``internal``
     Similar to private, but the value shows as a local symbol
     (``STB_LOCAL`` in the case of ELF) in the object file. This
@@ -681,8 +671,7 @@ Syntax::
 
     @<Name> = [Visibility] [DLLStorageClass] alias [Linkage] <AliaseeTy> @<Aliasee>
 
-The linkage must be one of ``private``, ``linker_private``,
-``linker_private_weak``, ``internal``, ``linkonce``, ``weak``,
+The linkage must be one of ``private``, ``internal``, ``linkonce``, ``weak``,
 ``linkonce_odr``, ``weak_odr``, ``external``. Note that some system linkers
 might not correctly handle dropping a weak symbol that is aliased by a non-weak
 alias.
@@ -6950,6 +6939,46 @@ is lowered to a constant 0.
 Note that runtime support may be conditional on the privilege-level code is
 running at and the host platform.
 
+'``llvm.clear_cache``' Intrinsic
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Syntax:
+"""""""
+
+::
+
+      declare void @llvm.clear_cache(i8*, i8*)
+
+Overview:
+"""""""""
+
+The '``llvm.clear_cache``' intrinsic provides access to the systemcall
+that flushes the cache at the range specified. Some targets need this
+to specifically flush the instruction cache when executable data changes
+in memory (self-modifying code). Other targets have unified intruction
+and data cache, so they don't need any calls.
+
+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). 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
 -----------------------------