LLVM 24.0.0git
CodeGenOptions.h
Go to the documentation of this file.
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
17#include <string>
18
19namespace llvm {
20class Triple;
22enum class VectorLibrary;
23namespace cl {
25} // namespace cl
26} // namespace llvm
27
28namespace llvm::driver {
29// The current supported vector libraries in enum \VectorLibrary are 9(including
30// the NoLibrary). Changing the bitcount from 3 to 4 so that more than 8 values
31// can be supported. Now the maximum number of vector libraries supported
32// increase from 8(2^3) to 16(2^4).
33//
34// ENUM_CODEGENOPT(VecLib, llvm::driver::VectorLibrary,
35// <bitcount>4</bitcount>, llvm::driver::VectorLibrary::NoLibrary) is the
36// currently defined in clang/include/clang/Basic/CodeGenOptions.def
37// bitcount is the number of bits used to represent the enum value.
38//
39// IMPORTANT NOTE: When adding a new vector library support, and if count of
40// supported vector libraries crosses the current max limit. Please increment
41// the bitcount value.
42
43/// Vector library option used with -fveclib=
44enum class VectorLibrary {
45 NoLibrary, // Don't use any vector library.
46 Accelerate, // Use the Accelerate framework.
47 LIBMVEC, // GLIBC vector math library.
48 MASSV, // IBM MASS vector library.
49 SVML, // Intel short vector math library.
50 SLEEF, // SLEEF SIMD Library for Evaluating Elementary Functions.
51 Darwin_libsystem_m, // Use Darwin's libsystem_m vector functions.
52 ArmPL, // Arm Performance Libraries.
53 AMDLIBM // AMD vector math library.
54};
55
58
60 VectorLibrary Veclib);
61
63 ProfileNone, // Profile instrumentation is turned off.
64 ProfileClangInstr, // Clang instrumentation to generate execution counts
65 // to use with PGO.
66 ProfileIRInstr, // IR level PGO instrumentation in LLVM.
67 ProfileCSIRInstr, // IR level PGO context sensitive instrumentation in LLVM.
68 ProfileIRSampleColdCov, // IR level sample pgo based cold function coverage
69 // instrumentation in LLVM.
70};
71
72// Default filename used for profile generation.
73LLVM_ABI std::string
75} // end namespace llvm::driver
76
77#endif
#define LLVM_ABI
Definition Compiler.h:211
Implementation of the target library information.
Triple - Helper class for working with autoconf configuration names.
Definition Triple.h:48
This namespace contains all of the command line option processing machinery.
Definition CodeGenData.h:33
LLVM_ABI TargetLibraryInfoImpl * createTLII(const llvm::Triple &TargetTriple, VectorLibrary Veclib)
LLVM_ABI std::string getDefaultProfileGenName(const cl::LibraryOptionsContext &LibraryOptions)
VectorLibrary
Vector library option used with -fveclib=.
LLVM_ABI llvm::VectorLibrary convertDriverVectorLibraryToVectorLibrary(llvm::driver::VectorLibrary VecLib)
This is an optimization pass for GlobalISel generic memory operations.
VectorLibrary
List of known vector-functions libraries.