clang ===== The NEC LLVM-IR Vectorizer uses the :program:`clang` as front-end, so non-architectural options and predefined macros of the :program:`clang` are available. This chapter is specialized for the NEC LLVM-IR Vectorizer. Synopsis -------- :program:`clang` -target ve-linux -fnvec \-\-nvec-path=<*directory*> [*clang* *options*] [*llvm-vec* *options*] *filename* Example of compiling and linking a C source file. .. code-block:: console $ clang -target ve-linux -fnvec a.c Example of compiling and linking with llvm-vec option (-faggressive-associative-math). .. code-block:: console $ clang -target ve-linux -fnvec -faggressive-associative-math a.c Description ----------- The clang inputs a C/C++ source file, and outputs LLVM-IR source codes for the NEC LLVM-IR Vectorizer. Options ------- | The following options are added. You can also specify options for the NEC LLVM-IR Vectorizer Command. | See also :doc:`LLVMVecCommand`. .. option:: -target Generates code for the given target. Specifies ve-linux as the target when using the NEC LLVM-IR Vectorizer. .. option:: -fnvec Enables the NEC LLVM-IR Vectorizer. .. option:: --nvec-path= Specifies installation directory for the NEC LLVM-IR Vectorizer. Predefined Macros ----------------- The following predefined macros are added. .. program:: clang .. option:: __ve, __ve__ Always defined as 1. .. _Compiler-directives: Compiler Directives ------------------- The following Compiler Directives are supported. * [no]advance_gather * [no]assume * gather_reorder * ivdep * [no]list_vector * [no]lstval * move / move_unsafe / nomove * nofma * [no]packed_vector * shortloop * [no]sparse * [no]vector * [no]verror_check * [no]vob * [no]vovertake * [no]vwork These are placed immediately before a for, while, do-while, or c++11 range-based for loop like `#pragma unroll `_\. For details on compiler directives, see `C/C++ Compiler User's Guide in documents `_\. Remarks ------- * The default optimization level is changed to -O1. * Clang for NEC LLVM-IR Vectorizer is Reference Implementation of VE. There is no quality guarantee.