[clang] 8fdd578 - [OpenCL][Docs] Describe tablegen BIFs declarations.

Anastasia Stulova via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 25 03:24:35 PST 2021


Author: Anastasia Stulova
Date: 2021-01-25T11:17:03Z
New Revision: 8fdd5784f0d30b165602343a96a34611779b007b

URL: https://github.com/llvm/llvm-project/commit/8fdd5784f0d30b165602343a96a34611779b007b
DIFF: https://github.com/llvm/llvm-project/commit/8fdd5784f0d30b165602343a96a34611779b007b.diff

LOG: [OpenCL][Docs] Describe tablegen BIFs declarations.

Added documentation for the fast builtin
function declarations with -fdeclare-opencl-builtins.

Tags: #clang

Differential Revision: https://reviews.llvm.org/D95038

Added: 
    

Modified: 
    clang/docs/OpenCLSupport.rst
    clang/docs/UsersManual.rst

Removed: 
    


################################################################################
diff  --git a/clang/docs/OpenCLSupport.rst b/clang/docs/OpenCLSupport.rst
index 5be7e91adcaf..0eaf0f300ee4 100644
--- a/clang/docs/OpenCLSupport.rst
+++ b/clang/docs/OpenCLSupport.rst
@@ -112,6 +112,28 @@ Feel free to contact us on `cfe-dev
 <https://lists.llvm.org/mailman/listinfo/cfe-dev>`_ or via `Bugzilla
 <https://bugs.llvm.org/>`__.
 
+Fast builtin function declarations
+----------------------------------
+
+In addition to regular header includes with builtin types and functions using
+``-finclude-default-header`` explained in :doc:`UsersManual`, clang
+supports a fast mechanism to declare builtin functions with
+``-fdeclare-opencl-builtins``. This does not declare the builtin types and
+therefore it has to be used in combination with ``-finclude-default-header``
+if full functionality is required.
+
+**Example of Use**:
+
+    .. code-block:: console
+ 
+      $ clang -Xclang -finclude-default-header test.cl
+
+Note that this is a frontend-only flag and therefore it requires the use of
+flags that forward options to the frontend, e.g. ``-cc1`` or ``-Xclang``.
+
+As this feature is still in experimental phase some changes might still occur
+on the command line interface side.
+
 C++ libraries for OpenCL
 ------------------------
 

diff  --git a/clang/docs/UsersManual.rst b/clang/docs/UsersManual.rst
index a7b698d77c47..fe944a0166b8 100644
--- a/clang/docs/UsersManual.rst
+++ b/clang/docs/UsersManual.rst
@@ -3021,6 +3021,11 @@ To enable modules for OpenCL:
 
      $ clang -target spir-unknown-unknown -c -emit-llvm -Xclang -finclude-default-header -fmodules -fimplicit-module-maps -fmodules-cache-path=<path to the generated module> test.cl
 
+Another way to circumvent long parsing latency for the OpenCL builtin
+declarations is to use mechanism enabled by ``-fdeclare-opencl-builtins`` flag
+that is available as an experimental feature (see more information in
+:doc:`OpenCLSupport`).
+
 OpenCL Extensions
 -----------------
 


        


More information about the cfe-commits mailing list