32 cl::desc(
"Architecture to generate code for (see --version)"));
36 cl::desc(
"Target a specific cpu type (-mcpu=help for details)"),
41 cl::desc(
"Target specific attributes (-mattr=help for details)"),
45 "relocation-model",
cl::desc(
"Choose relocation model"),
49 "Fully relocatable, position independent code"),
51 "Relocatable external references, non-relocatable code"),
53 "Code and read-only data relocatable, accessed PC-relative"),
56 "Read-write data relocatable, accessed relative to static base"),
58 "Combination of ropi and rwpi")));
61 if (RelocModel.getNumOccurrences()) {
69 "thread-model",
cl::desc(
"Choose threading model"),
73 "Single thread model")));
76 "code-model",
cl::desc(
"Choose code model"),
84 if (CMModel.getNumOccurrences()) {
92 "exception-model",
cl::desc(
"exception model"),
96 "default exception handling model"),
98 "DWARF-like CFI based exception handling"),
102 "Windows exception model"),
104 "WebAssembly exception handling")));
109 "Choose a file type (not all types are supported by all targets):"),
111 "Emit an assembly ('.s') file"),
113 "Emit a native object ('.o') file"),
115 "Emit nothing, for performance testing")));
118 "frame-pointer",
cl::desc(
"Specify frame pointer elimination optimization"),
122 "Disable frame pointer elimination"),
124 "Disable frame pointer elimination for non-leaf frame"),
126 "Enable frame pointer elimination")));
129 "enable-unsafe-fp-math",
130 cl::desc(
"Enable optimizations that may decrease FP precision"),
134 "enable-no-infs-fp-math",
135 cl::desc(
"Enable FP math optimizations that assume no +-Infs"),
139 "enable-no-nans-fp-math",
140 cl::desc(
"Enable FP math optimizations that assume no NaNs"),
144 "enable-no-signed-zeros-fp-math",
145 cl::desc(
"Enable FP math optimizations that assume " 146 "the sign of 0 is insignificant"),
150 EnableNoTrappingFPMath(
"enable-no-trapping-fp-math",
151 cl::desc(
"Enable setting the FP exceptions build " 152 "attribute not to use exceptions"),
157 cl::desc(
"Select which denormal numbers the code is permitted to require"),
160 "IEEE 754 denormal numbers"),
162 "the sign of a flushed-to-zero number is preserved " 165 "denormals are flushed to positive zero")));
168 "enable-sign-dependent-rounding-fp-math",
cl::Hidden,
169 cl::desc(
"Force codegen to assume rounding mode can change dynamically"),
175 "Target default float ABI type"),
177 "Soft float ABI (implied by -soft-float)"),
179 "Hard float ABI (uses FP registers)")));
182 "fp-contract",
cl::desc(
"Enable aggressive formation of fused FP ops"),
188 "Only fuse FP ops when the result won't be affected.")));
191 "nozero-initialized-in-bss",
192 cl::desc(
"Don't place zero-initialized symbols into bss section"),
198 "Turn fastcc calls into tail calls by (potentially) changing ABI."),
205 static cl::opt<bool> StackSymbolOrdering(
"stack-symbol-ordering",
206 cl::desc(
"Order local stack symbols."),
210 OverrideStackAlignment(
"stack-alignment",
211 cl::desc(
"Override default stack alignment"),
215 StackRealign(
"stackrealign",
216 cl::desc(
"Force align the stack to the minimum alignment"),
221 cl::desc(
"Emit a call to trap function rather than a trap instruction"),
225 cl::desc(
"Use .ctors instead of .init_array."),
229 "relax-elf-relocations",
230 cl::desc(
"Emit GOTPCRELX/REX_GOTPCRELX instead of GOTPCREL on x86-64 ELF"),
234 cl::desc(
"Emit data into separate sections"),
238 FunctionSections(
"function-sections",
239 cl::desc(
"Emit functions into separate sections"),
247 UniqueSectionNames(
"unique-section-names",
248 cl::desc(
"Give unique names to every section"),
252 EABIVersion(
"meabi",
cl::desc(
"Set EABI type (default depends on triple):"),
255 "Triple default EABI version"),
261 "debugger-tune",
cl::desc(
"Tune debug info for a particular debugger"),
268 "stack-size-section",
269 cl::desc(
"Emit a section containing stack size metadata"),
cl::init(
false));
272 EnableAddrsig(
"addrsig",
cl::desc(
"Emit an address-significance table"),
287 EnableHonorSignDependentRoundingFPMath;
305 Options.
MCOptions = InitMCTargetOptionsFromFlags();
318 if (MCPU ==
"native")
331 if (MCPU ==
"native") {
334 for (
auto &
F : HostFeatures)
338 for (
unsigned i = 0; i != MAttrs.size(); ++i)
351 if (MCPU ==
"native") {
354 for (
auto &
F : HostFeatures)
358 for (
unsigned i = 0; i != MAttrs.size(); ++i)
369 auto &Ctx =
F.getContext();
375 if (!Features.
empty())
377 if (FramePointerUsage.getNumOccurrences() > 0) {
385 if (DisableTailCalls.getNumOccurrences() > 0)
391 if (TrapFuncName.getNumOccurrences() > 0)
394 if (
auto *Call = dyn_cast<CallInst>(&
I))
395 if (
const auto *F =
Call->getCalledFunction())
unsigned StackSymbolOrdering
StackSymbolOrdering - When true, this will allow CodeGen to order the local stack symbols (for code s...
unsigned NoTrappingFPMath
NoTrappingFPMath - This flag is enabled when the -enable-no-trapping-fp-math is specified on the comm...
MCTargetOptions MCOptions
Machine level options.
This class represents lattice values for constants.
A Module instance is used to store all the information related to an LLVM module. ...
EABI EABIVersion
EABIVersion - This flag specifies the EABI version.
unsigned DataSections
Emit data into separate sections.
DWARF-like instruction based exceptions.
std::string getString() const
Returns features as a string.
const FeatureBitset Features
setjmp/longjmp based exceptions
AttrBuilder & addAttribute(Attribute::AttrKind Val)
Add an attribute to the builder.
ThreadModel::Model ThreadModel
ThreadModel - This flag specifies the type of threading model to assume for things like atomics...
ExceptionHandling ExceptionModel
What exception model to use.
void AddFeature(StringRef String, bool Enable=true)
Adds Features.
unsigned NoNaNsFPMath
NoNaNsFPMath - This flag is enabled when the -enable-no-nans-fp-math flag is specified on the command...
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
unsigned FunctionSections
Emit functions into separate sections.
unsigned UniqueSectionNames
constexpr char Attrs[]
Key for Kernel::Metadata::mAttrs.
static Reloc::Model getRelocModel(Optional< Reloc::Model > RM)
Windows Exception Handling.
DebuggerKind DebuggerTuning
Which debugger to tune for.
initializer< Ty > init(const Ty &Val)
const std::vector< std::string > & getFeatures() const
Returns the vector of individual subtarget features.
unsigned UnsafeFPMath
UnsafeFPMath - This flag is enabled when the -enable-unsafe-fp-math flag is specified on the command ...
FPOpFusion::FPOpFusionMode AllowFPOpFusion
AllowFPOpFusion - This flag is set by the -fuse-fp-ops=xxx option.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
unsigned ExplicitEmulatedTLS
Whether -emulated-tls or -no-emulated-tls is set.
ValuesClass values(OptsTy... Options)
Helper to build a ValuesClass by forwarding a variable number of arguments as an initializer list to ...
unsigned EmitStackSizeSection
Emit section containing metadata on function stack sizes.
unsigned GuaranteedTailCallOpt
GuaranteedTailCallOpt - This flag is enabled when -tailcallopt is specified on the commandline...
unsigned NoInfsFPMath
NoInfsFPMath - This flag is enabled when the -enable-no-infs-fp-math flag is specified on the command...
FPDenormal::DenormalMode FPDenormalMode
FPDenormalMode - This flags specificies which denormal numbers the code is permitted to require...
unsigned NoZerosInBSS
NoZerosInBSS - By default some codegens place zero-initialized data to .bss section.
StringRef toStringRef(bool B)
Construct a string ref from a boolean.
unsigned UseInitArray
UseInitArray - Use .init_array instead of .ctors for static constructors.
Module.h This file contains the declarations for the Module class.
unsigned EmitAddrsig
Emit address-significance table.
unsigned StackAlignmentOverride
StackAlignmentOverride - Override default stack alignment for target.
Manages the enabling and disabling of subtarget specific features.
unsigned EmulatedTLS
EmulatedTLS - This flag enables emulated TLS model, using emutls function in the runtime library...
unsigned RelaxELFRelocations
#define clEnumValN(ENUMVAL, FLAGNAME, DESC)
StringRef getHostCPUName()
getHostCPUName - Get the LLVM name for the host CPU.
static Attribute get(LLVMContext &Context, AttrKind Kind, uint64_t Val=0)
Return a uniquified Attribute object.
LLVM_NODISCARD AttributeList addAttributes(LLVMContext &C, unsigned Index, const AttrBuilder &B) const
Add attributes to the attribute set at the given index.
unsigned HonorSignDependentRoundingFPMathOption
HonorSignDependentRoundingFPMath - This returns true when the -enable-sign-dependent-rounding-fp-math...
unsigned NoSignedZerosFPMath
NoSignedZerosFPMath - This flag is enabled when the -enable-no-signed-zeros-fp-math is specified on t...
StringRef - Represent a constant reference to a string, i.e.
bool getHostCPUFeatures(StringMap< bool > &Features)
getHostCPUFeatures - Get the LLVM names for the host CPU features.
#define LLVM_ATTRIBUTE_UNUSED
FloatABI::ABIType FloatABIType
FloatABIType - This setting is set by -float-abi=xxx option is specfied on the command line...