1 //===-- llvm/Target/TargetOptions.h - Target Options ------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines command line option flags that are shared across various
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_TARGET_TARGETOPTIONS_H
16 #define LLVM_TARGET_TARGETOPTIONS_H
19 class MachineFunction;
21 // Possible float ABI settings. Used with FloatABIType in TargetOptions.h.
24 Default, // Target-specific (either soft of hard depending on triple, etc).
30 /// PrintMachineCode - This flag is enabled when the -print-machineinstrs
31 /// option is specified on the command line, and should enable debugging
32 /// output from the code generator.
33 extern bool PrintMachineCode;
35 /// NoFramePointerElim - This flag is enabled when the -disable-fp-elim is
36 /// specified on the command line. If the target supports the frame pointer
37 /// elimination optimization, this option should disable it.
38 extern bool NoFramePointerElim;
40 /// NoFramePointerElimNonLeaf - This flag is enabled when the
41 /// -disable-non-leaf-fp-elim is specified on the command line. If the target
42 /// supports the frame pointer elimination optimization, this option should
43 /// disable it for non-leaf functions.
44 extern bool NoFramePointerElimNonLeaf;
46 /// DisableFramePointerElim - This returns true if frame pointer elimination
47 /// optimization should be disabled for the given machine function.
48 extern bool DisableFramePointerElim(const MachineFunction &MF);
50 /// LessPreciseFPMAD - This flag is enabled when the
51 /// -enable-fp-mad is specified on the command line. When this flag is off
52 /// (the default), the code generator is not allowed to generate mad
53 /// (multiply add) if the result is "less precise" than doing those operations
55 extern bool LessPreciseFPMADOption;
56 extern bool LessPreciseFPMAD();
58 /// NoExcessFPPrecision - This flag is enabled when the
59 /// -disable-excess-fp-precision flag is specified on the command line. When
60 /// this flag is off (the default), the code generator is allowed to produce
61 /// results that are "more precise" than IEEE allows. This includes use of
62 /// FMA-like operations and use of the X86 FP registers without rounding all
64 extern bool NoExcessFPPrecision;
66 /// UnsafeFPMath - This flag is enabled when the
67 /// -enable-unsafe-fp-math flag is specified on the command line. When
68 /// this flag is off (the default), the code generator is not allowed to
69 /// produce results that are "less precise" than IEEE allows. This includes
70 /// use of X86 instructions like FSIN and FCOS instead of libcalls.
71 /// UnsafeFPMath implies FiniteOnlyFPMath and LessPreciseFPMAD.
72 extern bool UnsafeFPMath;
74 /// FiniteOnlyFPMath - This returns true when the -enable-finite-only-fp-math
75 /// option is specified on the command line. If this returns false (default),
76 /// the code generator is not allowed to assume that FP arithmetic arguments
77 /// and results are never NaNs or +-Infs.
78 extern bool FiniteOnlyFPMathOption;
79 extern bool FiniteOnlyFPMath();
81 /// HonorSignDependentRoundingFPMath - This returns true when the
82 /// -enable-sign-dependent-rounding-fp-math is specified. If this returns
83 /// false (the default), the code generator is allowed to assume that the
84 /// rounding behavior is the default (round-to-zero for all floating point to
85 /// integer conversions, and round-to-nearest for all other arithmetic
86 /// truncations). If this is enabled (set to true), the code generator must
87 /// assume that the rounding mode may dynamically change.
88 extern bool HonorSignDependentRoundingFPMathOption;
89 extern bool HonorSignDependentRoundingFPMath();
91 /// UseSoftFloat - This flag is enabled when the -soft-float flag is specified
92 /// on the command line. When this flag is on, the code generator will
93 /// generate libcalls to the software floating point library instead of
94 /// target FP instructions.
95 extern bool UseSoftFloat;
97 /// FloatABIType - This setting is set by -float-abi=xxx option is specfied
98 /// on the command line. This setting may either be Default, Soft, or Hard.
99 /// Default selects the target's default behavior. Soft selects the ABI for
100 /// UseSoftFloat, but does not inidcate that FP hardware may not be used.
101 /// Such a combination is unfortunately popular (e.g. arm-apple-darwin).
102 /// Hard presumes that the normal FP ABI is used.
103 extern FloatABI::ABIType FloatABIType;
105 /// NoZerosInBSS - By default some codegens place zero-initialized data to
106 /// .bss section. This flag disables such behaviour (necessary, e.g. for
107 /// crt*.o compiling).
108 extern bool NoZerosInBSS;
110 /// DwarfExceptionHandling - This flag indicates that Dwarf exception
111 /// information should be emitted.
112 extern bool DwarfExceptionHandling;
114 /// SjLjExceptionHandling - This flag indicates that SJLJ exception
115 /// information should be emitted.
116 extern bool SjLjExceptionHandling;
118 /// JITEmitDebugInfo - This flag indicates that the JIT should try to emit
119 /// debug information and notify a debugger about it.
120 extern bool JITEmitDebugInfo;
122 /// JITEmitDebugInfoToDisk - This flag indicates that the JIT should write
123 /// the object files generated by the JITEmitDebugInfo flag to disk. This
124 /// flag is hidden and is only for debugging the debug info.
125 extern bool JITEmitDebugInfoToDisk;
127 /// UnwindTablesMandatory - This flag indicates that unwind tables should
128 /// be emitted for all functions.
129 extern bool UnwindTablesMandatory;
131 /// GuaranteedTailCallOpt - This flag is enabled when -tailcallopt is
132 /// specified on the commandline. When the flag is on, participating targets
133 /// will perform tail call optimization on all calls which use the fastcc
134 /// calling convention and which satisfy certain target-independent
135 /// criteria (being at the end of a function, having the same return type
136 /// as their parent function, etc.), using an alternate ABI if necessary.
137 extern bool GuaranteedTailCallOpt;
139 /// StackAlignment - Override default stack alignment for target.
140 extern unsigned StackAlignment;
142 /// RealignStack - This flag indicates, whether stack should be automatically
143 /// realigned, if needed.
144 extern bool RealignStack;
146 /// DisableJumpTables - This flag indicates jump tables should not be
148 extern bool DisableJumpTables;
150 /// EnableFastISel - This flag enables fast-path instruction selection
151 /// which trades away generated code quality in favor of reducing
153 extern bool EnableFastISel;
155 /// StrongPHIElim - This flag enables more aggressive PHI elimination
156 /// wth earlier copy coalescing.
157 extern bool StrongPHIElim;
159 } // End llvm namespace