15#ifndef FORTRAN_FRONTEND_CODEGENOPTIONS_H
16#define FORTRAN_FRONTEND_CODEGENOPTIONS_H
18#include "flang/Optimizer/OpenMP/Utils.h"
19#include "llvm/Frontend/Debug/Options.h"
20#include "llvm/Frontend/Driver/CodeGenOptions.h"
21#include "llvm/Support/CodeGen.h"
22#include "llvm/Support/Regex.h"
23#include "llvm/Target/TargetOptions.h"
24#include "llvm/Transforms/Instrumentation/AddressSanitizerOptions.h"
31namespace Fortran::frontend {
38#define CODEGENOPT(Name, Bits, Default) unsigned Name : Bits;
39#define ENUM_CODEGENOPT(Name, Type, Bits, Default)
40#include "flang/Frontend/CodeGenOptions.def"
43#define CODEGENOPT(Name, Bits, Default)
44#define ENUM_CODEGENOPT(Name, Type, Bits, Default) unsigned Name : Bits;
45#include "flang/Frontend/CodeGenOptions.def"
93 enum class RemarkKind {
104 llvm::CodeObjectVersionKind::COV_None;
108 RemarkKind Kind = RemarkKind::RK_Missing;
110 std::shared_ptr<llvm::Regex> Regex;
173 return getProfileInstr() == llvm::driver::ProfileClangInstr;
178 return getProfileInstr() == llvm::driver::ProfileIRInstr;
183 return getProfileInstr() == llvm::driver::ProfileCSIRInstr;
187 return getProfileUse() == llvm::driver::ProfileIRInstr ||
188 getProfileUse() == llvm::driver::ProfileCSIRInstr;
192 return getProfileUse() == llvm::driver::ProfileCSIRInstr;
221#define CODEGENOPT(Name, Bits, Default)
222#define ENUM_CODEGENOPT(Name, Type, Bits, Default) \
223 Type get##Name() const { return static_cast<Type>(Name); } \
224 void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
225#include "flang/Frontend/CodeGenOptions.def"
230std::optional<llvm::CodeModel::Model> getCodeModel(llvm::StringRef
string);
Definition CodeGenOptions.h:35
Definition CodeGenOptions.h:50
std::string MemoryProfileUsePath
Name of the profile file to use as input for -fmemory-profile-use.
Definition CodeGenOptions.h:162
std::string PreferVectorWidth
The prefered vector width, if requested by -mprefer-vector-width.
Definition CodeGenOptions.h:57
std::string OptRecordPasses
Definition CodeGenOptions.h:82
std::vector< std::string > DependentLibs
Options to add to the linker for the object file.
Definition CodeGenOptions.h:88
bool hasProfileClangInstr() const
Check if Clang profile instrumenation is on.
Definition CodeGenOptions.h:172
OptRemark OptimizationRemark
Definition CodeGenOptions.h:131
llvm::CodeObjectVersionKind CodeObjectVersion
Code object version for AMDGPU.
Definition CodeGenOptions.h:103
OptRemark OptimizationRemarkAnalysis
Definition CodeGenOptions.h:144
std::string InstrProfileOutput
Definition CodeGenOptions.h:159
std::string ProfileRemappingFile
Definition CodeGenOptions.h:169
std::string Reciprocals
List of reciprocal estimate sub-options.
Definition CodeGenOptions.h:60
std::vector< std::string > LLVMPassPlugins
The paths to the pass plugins that were registered using -fpass-plugin.
Definition CodeGenOptions.h:54
std::string OptRecordFormat
The format used for serializing remarks (default: YAML)
Definition CodeGenOptions.h:85
std::optional< std::string > SaveTempsDir
The directory where temp files are stored if specified by -save-temps.
Definition CodeGenOptions.h:71
flangomp::DoConcurrentMappingKind DoConcurrentMappingKind
Definition CodeGenOptions.h:155
bool hasProfileCSIRInstr() const
Check if CS IR level profile instrumentation is on.
Definition CodeGenOptions.h:182
std::string CodeModel
The code model to use (-mcmodel).
Definition CodeGenOptions.h:147
std::vector< std::string > OffloadObjects
Definition CodeGenOptions.h:64
ComplexRangeKind
Controls the various implementations for complex division.
Definition CodeGenOptions.h:196
@ CX_Full
Definition CodeGenOptions.h:200
@ CX_None
No range rule is enabled.
Definition CodeGenOptions.h:214
@ CX_Basic
Definition CodeGenOptions.h:211
@ CX_Improved
Definition CodeGenOptions.h:206
std::string ProfileInstrumentUsePath
Name of the profile file to use as input for -fprofile-instr-use.
Definition CodeGenOptions.h:165
std::optional< std::string > RecordCommandLine
The string containing the commandline for the llvm.commandline metadata.
Definition CodeGenOptions.h:74
std::string OptRecordFile
Definition CodeGenOptions.h:78
std::vector< std::string > BuiltinBCLibs
Definition CodeGenOptions.h:68
uint64_t LargeDataThreshold
Definition CodeGenOptions.h:151
OptRemark OptimizationRemarkMissed
Definition CodeGenOptions.h:137
bool hasProfileIRInstr() const
Check if IR level profile instrumentation is on.
Definition CodeGenOptions.h:177
bool hasProfileCSIRUse() const
Check if CSIR profile use is on.
Definition CodeGenOptions.h:191
bool hasProfileIRUse() const
Check if IR level profile use is on.
Definition CodeGenOptions.h:186