LLVM
22.0.0git
lib
Frontend
Driver
CodeGenOptions.cpp
Go to the documentation of this file.
1
//===--- CodeGenOptions.cpp - Shared codegen option handling --------------===//
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
#include "
llvm/Frontend/Driver/CodeGenOptions.h
"
10
#include "
llvm/Analysis/TargetLibraryInfo.h
"
11
#include "
llvm/ProfileData/InstrProfCorrelator.h
"
12
#include "
llvm/TargetParser/Triple.h
"
13
14
namespace
llvm
{
15
extern
llvm::cl::opt<bool>
DebugInfoCorrelate
;
16
extern
llvm::cl::opt<llvm::InstrProfCorrelator::ProfCorrelatorKind>
17
ProfileCorrelate
;
18
}
// namespace llvm
19
20
namespace
llvm::driver
{
21
22
TargetLibraryInfoImpl
*
createTLII
(
const
llvm::Triple
&TargetTriple,
23
driver::VectorLibrary
Veclib) {
24
TargetLibraryInfoImpl
*TLII =
new
TargetLibraryInfoImpl
(TargetTriple);
25
26
using
VectorLibrary
=
llvm::driver::VectorLibrary
;
27
switch
(Veclib) {
28
case
VectorLibrary::Accelerate
:
29
TLII->
addVectorizableFunctionsFromVecLib
(
TargetLibraryInfoImpl::Accelerate
,
30
TargetTriple);
31
break
;
32
case
VectorLibrary::LIBMVEC
:
33
TLII->
addVectorizableFunctionsFromVecLib
(
TargetLibraryInfoImpl::LIBMVEC
,
34
TargetTriple);
35
break
;
36
case
VectorLibrary::MASSV
:
37
TLII->
addVectorizableFunctionsFromVecLib
(
TargetLibraryInfoImpl::MASSV
,
38
TargetTriple);
39
break
;
40
case
VectorLibrary::SVML
:
41
TLII->
addVectorizableFunctionsFromVecLib
(
TargetLibraryInfoImpl::SVML
,
42
TargetTriple);
43
break
;
44
case
VectorLibrary::SLEEF
:
45
TLII->
addVectorizableFunctionsFromVecLib
(
TargetLibraryInfoImpl::SLEEFGNUABI
,
46
TargetTriple);
47
break
;
48
case
VectorLibrary::Darwin_libsystem_m
:
49
TLII->
addVectorizableFunctionsFromVecLib
(
50
TargetLibraryInfoImpl::DarwinLibSystemM
, TargetTriple);
51
break
;
52
case
VectorLibrary::ArmPL
:
53
TLII->
addVectorizableFunctionsFromVecLib
(
TargetLibraryInfoImpl::ArmPL
,
54
TargetTriple);
55
break
;
56
case
VectorLibrary::AMDLIBM
:
57
TLII->
addVectorizableFunctionsFromVecLib
(
TargetLibraryInfoImpl::AMDLIBM
,
58
TargetTriple);
59
break
;
60
default
:
61
break
;
62
}
63
return
TLII;
64
}
65
66
std::string
getDefaultProfileGenName
() {
67
return
llvm::DebugInfoCorrelate
||
68
llvm::ProfileCorrelate
!=
InstrProfCorrelator::NONE
69
?
"default_%m.proflite"
70
:
"default_%m.profraw"
;
71
}
72
}
// namespace llvm::driver
CodeGenOptions.h
InstrProfCorrelator.h
TargetLibraryInfo.h
Triple.h
llvm::InstrProfCorrelator::NONE
@ NONE
Definition:
InstrProfCorrelator.h:39
llvm::TargetLibraryInfoImpl
Implementation of the target library information.
Definition:
TargetLibraryInfo.h:86
llvm::TargetLibraryInfoImpl::addVectorizableFunctionsFromVecLib
LLVM_ABI void addVectorizableFunctionsFromVecLib(enum VectorLibrary VecLib, const llvm::Triple &TargetTriple)
Calls addVectorizableFunctions with a known preset of functions for the given vector library.
Definition:
TargetLibraryInfo.cpp:1391
llvm::TargetLibraryInfoImpl::MASSV
@ MASSV
Definition:
TargetLibraryInfo.h:132
llvm::TargetLibraryInfoImpl::DarwinLibSystemM
@ DarwinLibSystemM
Definition:
TargetLibraryInfo.h:130
llvm::TargetLibraryInfoImpl::SVML
@ SVML
Definition:
TargetLibraryInfo.h:133
llvm::TargetLibraryInfoImpl::SLEEFGNUABI
@ SLEEFGNUABI
Definition:
TargetLibraryInfo.h:134
llvm::TargetLibraryInfoImpl::LIBMVEC
@ LIBMVEC
Definition:
TargetLibraryInfo.h:131
llvm::TargetLibraryInfoImpl::AMDLIBM
@ AMDLIBM
Definition:
TargetLibraryInfo.h:136
llvm::TargetLibraryInfoImpl::ArmPL
@ ArmPL
Definition:
TargetLibraryInfo.h:135
llvm::TargetLibraryInfoImpl::Accelerate
@ Accelerate
Definition:
TargetLibraryInfo.h:129
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition:
Triple.h:47
llvm::cl::opt
Definition:
CommandLine.h:1429
llvm::driver
Definition:
CodeGenOptions.h:24
llvm::driver::getDefaultProfileGenName
LLVM_ABI std::string getDefaultProfileGenName()
Definition:
CodeGenOptions.cpp:66
llvm::driver::createTLII
LLVM_ABI TargetLibraryInfoImpl * createTLII(const llvm::Triple &TargetTriple, VectorLibrary Veclib)
Definition:
CodeGenOptions.cpp:22
llvm::driver::VectorLibrary
VectorLibrary
Vector library option used with -fveclib=.
Definition:
CodeGenOptions.h:40
llvm::driver::VectorLibrary::LIBMVEC
@ LIBMVEC
llvm::driver::VectorLibrary::Darwin_libsystem_m
@ Darwin_libsystem_m
llvm::driver::VectorLibrary::SVML
@ SVML
llvm::driver::VectorLibrary::ArmPL
@ ArmPL
llvm::driver::VectorLibrary::AMDLIBM
@ AMDLIBM
llvm::driver::VectorLibrary::Accelerate
@ Accelerate
llvm::driver::VectorLibrary::SLEEF
@ SLEEF
llvm::driver::VectorLibrary::MASSV
@ MASSV
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition:
AddressRanges.h:18
llvm::DebugInfoCorrelate
LLVM_ABI cl::opt< bool > DebugInfoCorrelate
Definition:
CodeGenOptions.cpp:15
llvm::ProfileCorrelate
llvm::cl::opt< llvm::InstrProfCorrelator::ProfCorrelatorKind > ProfileCorrelate
Definition:
PGOInstrumentation.cpp:364
Generated on Sat Aug 30 2025 07:37:01 for LLVM by
1.9.6