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 // Possible float ABI settings. Used with FloatABIType in TargetOptions.h.
22 Default, // Target-specific (either soft of hard depending on triple, etc).
28 /// PrintMachineCode - This flag is enabled when the -print-machineinstrs
29 /// option is specified on the command line, and should enable debugging
30 /// output from the code generator.
31 extern bool PrintMachineCode;
33 /// NoFramePointerElim - This flag is enabled when the -disable-fp-elim is
34 /// specified on the command line. If the target supports the frame pointer
35 /// elimination optimization, this option should disable it.
36 extern bool NoFramePointerElim;
38 /// LessPreciseFPMAD - This flag is enabled when the
39 /// -enable-fp-mad is specified on the command line. When this flag is off
40 /// (the default), the code generator is not allowed to generate mad
41 /// (multiply add) if the result is "less precise" than doing those operations
43 extern bool LessPreciseFPMADOption;
44 extern bool LessPreciseFPMAD();
46 /// NoExcessFPPrecision - This flag is enabled when the
47 /// -disable-excess-fp-precision flag is specified on the command line. When
48 /// this flag is off (the default), the code generator is allowed to produce
49 /// results that are "more precise" than IEEE allows. This includes use of
50 /// FMA-like operations and use of the X86 FP registers without rounding all
52 extern bool NoExcessFPPrecision;
54 /// UnsafeFPMath - This flag is enabled when the
55 /// -enable-unsafe-fp-math flag is specified on the command line. When
56 /// this flag is off (the default), the code generator is not allowed to
57 /// produce results that are "less precise" than IEEE allows. This includes
58 /// use of X86 instructions like FSIN and FCOS instead of libcalls.
59 /// UnsafeFPMath implies FiniteOnlyFPMath and LessPreciseFPMAD.
60 extern bool UnsafeFPMath;
62 /// FiniteOnlyFPMath - This returns true when the -enable-finite-only-fp-math
63 /// option is specified on the command line. If this returns false (default),
64 /// the code generator is not allowed to assume that FP arithmetic arguments
65 /// and results are never NaNs or +-Infs.
66 extern bool FiniteOnlyFPMathOption;
67 extern bool FiniteOnlyFPMath();
69 /// HonorSignDependentRoundingFPMath - This returns true when the
70 /// -enable-sign-dependent-rounding-fp-math is specified. If this returns
71 /// false (the default), the code generator is allowed to assume that the
72 /// rounding behavior is the default (round-to-zero for all floating point to
73 /// integer conversions, and round-to-nearest for all other arithmetic
74 /// truncations). If this is enabled (set to true), the code generator must
75 /// assume that the rounding mode may dynamically change.
76 extern bool HonorSignDependentRoundingFPMathOption;
77 extern bool HonorSignDependentRoundingFPMath();
79 /// UseSoftFloat - This flag is enabled when the -soft-float flag is specified
80 /// on the command line. When this flag is on, the code generator will
81 /// generate libcalls to the software floating point library instead of
82 /// target FP instructions.
83 extern bool UseSoftFloat;
85 /// FloatABIType - This setting is set by -float-abi=xxx option is specfied
86 /// on the command line. This setting may either be Default, Soft, or Hard.
87 /// Default selects the target's default behavior. Soft selects the ABI for
88 /// UseSoftFloat, but does not inidcate that FP hardware may not be used.
89 /// Such a combination is unfortunately popular (e.g. arm-apple-darwin).
90 /// Hard presumes that the normal FP ABI is used.
91 extern FloatABI::ABIType FloatABIType;
93 /// NoZerosInBSS - By default some codegens place zero-initialized data to
94 /// .bss section. This flag disables such behaviour (necessary, e.g. for
95 /// crt*.o compiling).
96 extern bool NoZerosInBSS;
98 /// DwarfExceptionHandling - This flag indicates that Dwarf exception
99 /// information should be emitted.
100 extern bool DwarfExceptionHandling;
102 /// SjLjExceptionHandling - This flag indicates that SJLJ exception
103 /// information should be emitted.
104 extern bool SjLjExceptionHandling;
106 /// JITEmitDebugInfo - This flag indicates that the JIT should try to emit
107 /// debug information and notify a debugger about it.
108 extern bool JITEmitDebugInfo;
110 /// JITEmitDebugInfoToDisk - This flag indicates that the JIT should write
111 /// the object files generated by the JITEmitDebugInfo flag to disk. This
112 /// flag is hidden and is only for debugging the debug info.
113 extern bool JITEmitDebugInfoToDisk;
115 /// UnwindTablesMandatory - This flag indicates that unwind tables should
116 /// be emitted for all functions.
117 extern bool UnwindTablesMandatory;
119 /// GuaranteedTailCallOpt - This flag is enabled when -tailcallopt is
120 /// specified on the commandline. When the flag is on, participating targets
121 /// will perform tail call optimization on all calls which use the fastcc
122 /// calling convention and which satisfy certain target-independent
123 /// criteria (being at the end of a function, having the same return type
124 /// as their parent function, etc.), using an alternate ABI if necessary.
125 extern bool GuaranteedTailCallOpt;
127 /// StackAlignment - Override default stack alignment for target.
128 extern unsigned StackAlignment;
130 /// RealignStack - This flag indicates, whether stack should be automatically
131 /// realigned, if needed.
132 extern bool RealignStack;
134 /// DisableJumpTables - This flag indicates jump tables should not be
136 extern bool DisableJumpTables;
138 /// EnableFastISel - This flag enables fast-path instruction selection
139 /// which trades away generated code quality in favor of reducing
141 extern bool EnableFastISel;
143 /// StrongPHIElim - This flag enables more aggressive PHI elimination
144 /// wth earlier copy coalescing.
145 extern bool StrongPHIElim;
147 /// DisableScheduling - This flag disables instruction scheduling. In
148 /// particular, it assigns an ordering to the SDNodes, which the scheduler
149 /// uses instead of its normal heuristics to perform scheduling.
150 extern bool DisableScheduling;
152 } // End llvm namespace