xref: /freebsd/contrib/llvm-project/llvm/include/llvm/Frontend/Driver/CodeGenOptions.h (revision 700637cbb5e582861067a11aaca4d053546871d2)
1 //===--- CodeGenOptions.h ---------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 //  This file defines frontend codegen options common to clang and flang
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_FRONTEND_DRIVER_CODEGENOPTIONS_H
14 #define LLVM_FRONTEND_DRIVER_CODEGENOPTIONS_H
15 
16 #include "llvm/Support/Compiler.h"
17 #include <string>
18 
19 namespace llvm {
20 class Triple;
21 class TargetLibraryInfoImpl;
22 } // namespace llvm
23 
24 namespace llvm::driver {
25 // The current supported vector libraries in enum \VectorLibrary are 9(including
26 // the NoLibrary). Changing the bitcount from 3 to 4 so that more than 8 values
27 // can be supported. Now the maximum number of vector libraries supported
28 // increase from 8(2^3) to 16(2^4).
29 //
30 // ENUM_CODEGENOPT(VecLib, llvm::driver::VectorLibrary,
31 // <bitcount>4</bitcount>, llvm::driver::VectorLibrary::NoLibrary) is the
32 // currently defined in clang/include/clang/Basic/CodeGenOptions.def
33 // bitcount is the number of bits used to represent the enum value.
34 //
35 // IMPORTANT NOTE: When adding a new vector library support, and if count of
36 // supported vector libraries crosses the current max limit. Please increment
37 // the bitcount value.
38 
39 /// Vector library option used with -fveclib=
40 enum class VectorLibrary {
41   NoLibrary,          // Don't use any vector library.
42   Accelerate,         // Use the Accelerate framework.
43   LIBMVEC,            // GLIBC vector math library.
44   MASSV,              // IBM MASS vector library.
45   SVML,               // Intel short vector math library.
46   SLEEF,              // SLEEF SIMD Library for Evaluating Elementary Functions.
47   Darwin_libsystem_m, // Use Darwin's libsystem_m vector functions.
48   ArmPL,              // Arm Performance Libraries.
49   AMDLIBM             // AMD vector math library.
50 };
51 
52 LLVM_ABI TargetLibraryInfoImpl *createTLII(const llvm::Triple &TargetTriple,
53                                            VectorLibrary Veclib);
54 
55 enum ProfileInstrKind {
56   ProfileNone,       // Profile instrumentation is turned off.
57   ProfileClangInstr, // Clang instrumentation to generate execution counts
58                      // to use with PGO.
59   ProfileIRInstr,    // IR level PGO instrumentation in LLVM.
60   ProfileCSIRInstr,  // IR level PGO context sensitive instrumentation in LLVM.
61   ProfileIRSampleColdCov, // IR level sample pgo based cold function coverage
62                           // instrumentation in LLVM.
63 };
64 
65 // Default filename used for profile generation.
66 LLVM_ABI std::string getDefaultProfileGenName();
67 } // end namespace llvm::driver
68 
69 #endif
70