TargetOptions.h revision 226633
111820Sjulian//===-- llvm/Target/TargetOptions.h - Target Options ------------*- C++ -*-===//
211820Sjulian//
311820Sjulian//                     The LLVM Compiler Infrastructure
411820Sjulian//
511820Sjulian// This file is distributed under the University of Illinois Open Source
611820Sjulian// License. See LICENSE.TXT for details.
711820Sjulian//
811820Sjulian//===----------------------------------------------------------------------===//
911820Sjulian//
1011820Sjulian// This file defines command line option flags that are shared across various
1111820Sjulian// targets.
1211820Sjulian//
1311820Sjulian//===----------------------------------------------------------------------===//
1411820Sjulian
1511820Sjulian#ifndef LLVM_TARGET_TARGETOPTIONS_H
1611820Sjulian#define LLVM_TARGET_TARGETOPTIONS_H
1711820Sjulian
1811820Sjuliannamespace llvm {
1911820Sjulian  class MachineFunction;
2011820Sjulian
2111820Sjulian  // Possible float ABI settings. Used with FloatABIType in TargetOptions.h.
2211820Sjulian  namespace FloatABI {
2311820Sjulian    enum ABIType {
2411820Sjulian      Default, // Target-specific (either soft of hard depending on triple, etc).
2511820Sjulian      Soft, // Soft float.
2611820Sjulian      Hard  // Hard float.
2711820Sjulian    };
2811820Sjulian  }
2911820Sjulian
3011820Sjulian  /// PrintMachineCode - This flag is enabled when the -print-machineinstrs
3112268Sjulian  /// option is specified on the command line, and should enable debugging
3211820Sjulian  /// output from the code generator.
3311820Sjulian  extern bool PrintMachineCode;
3411820Sjulian
3511820Sjulian  /// NoFramePointerElim - This flag is enabled when the -disable-fp-elim is
3611820Sjulian  /// specified on the command line.  If the target supports the frame pointer
3711820Sjulian  /// elimination optimization, this option should disable it.
3811820Sjulian  extern bool NoFramePointerElim;
3911820Sjulian
4011820Sjulian  /// NoFramePointerElimNonLeaf - This flag is enabled when the
4111820Sjulian  /// -disable-non-leaf-fp-elim is specified on the command line. If the target
4211820Sjulian  /// supports the frame pointer elimination optimization, this option should
4311820Sjulian  /// disable it for non-leaf functions.
4411820Sjulian  extern bool NoFramePointerElimNonLeaf;
4511820Sjulian
4611820Sjulian  /// DisableFramePointerElim - This returns true if frame pointer elimination
4711820Sjulian  /// optimization should be disabled for the given machine function.
4811820Sjulian  extern bool DisableFramePointerElim(const MachineFunction &MF);
4911820Sjulian
5011820Sjulian  /// LessPreciseFPMAD - This flag is enabled when the
5111820Sjulian  /// -enable-fp-mad is specified on the command line.  When this flag is off
5211820Sjulian  /// (the default), the code generator is not allowed to generate mad
5311820Sjulian  /// (multiply add) if the result is "less precise" than doing those operations
5411820Sjulian  /// individually.
5511820Sjulian  extern bool LessPreciseFPMADOption;
5611820Sjulian  extern bool LessPreciseFPMAD();
5711820Sjulian
5811820Sjulian  /// NoExcessFPPrecision - This flag is enabled when the
5911820Sjulian  /// -disable-excess-fp-precision flag is specified on the command line.  When
6011820Sjulian  /// this flag is off (the default), the code generator is allowed to produce
6111820Sjulian  /// results that are "more precise" than IEEE allows.  This includes use of
6211820Sjulian  /// FMA-like operations and use of the X86 FP registers without rounding all
6311820Sjulian  /// over the place.
6412268Sjulian  extern bool NoExcessFPPrecision;
6512268Sjulian
6611820Sjulian  /// UnsafeFPMath - This flag is enabled when the
6711820Sjulian  /// -enable-unsafe-fp-math flag is specified on the command line.  When
6811820Sjulian  /// this flag is off (the default), the code generator is not allowed to
6911820Sjulian  /// produce results that are "less precise" than IEEE allows.  This includes
7011820Sjulian  /// use of X86 instructions like FSIN and FCOS instead of libcalls.
7111820Sjulian  /// UnsafeFPMath implies LessPreciseFPMAD.
7211820Sjulian  extern bool UnsafeFPMath;
7311820Sjulian
7411820Sjulian  /// NoInfsFPMath - This flag is enabled when the
7511820Sjulian  /// -enable-no-infs-fp-math flag is specified on the command line. When
7611820Sjulian  /// this flag is off (the default), the code generator is not allowed to
7711820Sjulian  /// assume the FP arithmetic arguments and results are never +-Infs.
7811820Sjulian  extern bool NoInfsFPMath;
7911820Sjulian
8011820Sjulian  /// NoNaNsFPMath - This flag is enabled when the
8111820Sjulian  /// -enable-no-nans-fp-math flag is specified on the command line. When
8211820Sjulian  /// this flag is off (the default), the code generator is not allowed to
8311820Sjulian  /// assume the FP arithmetic arguments and results are never NaNs.
8411820Sjulian  extern bool NoNaNsFPMath;
8511820Sjulian
8611820Sjulian  /// HonorSignDependentRoundingFPMath - This returns true when the
8711820Sjulian  /// -enable-sign-dependent-rounding-fp-math is specified.  If this returns
8811820Sjulian  /// false (the default), the code generator is allowed to assume that the
8911820Sjulian  /// rounding behavior is the default (round-to-zero for all floating point to
9011820Sjulian  /// integer conversions, and round-to-nearest for all other arithmetic
9111820Sjulian  /// truncations).  If this is enabled (set to true), the code generator must
9211820Sjulian  /// assume that the rounding mode may dynamically change.
9311820Sjulian  extern bool HonorSignDependentRoundingFPMathOption;
9411820Sjulian  extern bool HonorSignDependentRoundingFPMath();
9511820Sjulian
9611820Sjulian  /// UseSoftFloat - This flag is enabled when the -soft-float flag is specified
9711820Sjulian  /// on the command line.  When this flag is on, the code generator will
9811820Sjulian  /// generate libcalls to the software floating point library instead of
9911820Sjulian  /// target FP instructions.
10011820Sjulian  extern bool UseSoftFloat;
10111820Sjulian
10211820Sjulian  /// FloatABIType - This setting is set by -float-abi=xxx option is specfied
10311820Sjulian  /// on the command line. This setting may either be Default, Soft, or Hard.
10411820Sjulian  /// Default selects the target's default behavior. Soft selects the ABI for
10511820Sjulian  /// UseSoftFloat, but does not inidcate that FP hardware may not be used.
10611820Sjulian  /// Such a combination is unfortunately popular (e.g. arm-apple-darwin).
10711820Sjulian  /// Hard presumes that the normal FP ABI is used.
10811820Sjulian  extern FloatABI::ABIType FloatABIType;
10911820Sjulian
11011820Sjulian  /// NoZerosInBSS - By default some codegens place zero-initialized data to
11111820Sjulian  /// .bss section. This flag disables such behaviour (necessary, e.g. for
11211820Sjulian  /// crt*.o compiling).
11311820Sjulian  extern bool NoZerosInBSS;
11411820Sjulian
11511820Sjulian  /// JITExceptionHandling - This flag indicates that the JIT should emit
11611820Sjulian  /// exception handling information.
11711820Sjulian  extern bool JITExceptionHandling;
11811820Sjulian
11911820Sjulian  /// JITEmitDebugInfo - This flag indicates that the JIT should try to emit
12011820Sjulian  /// debug information and notify a debugger about it.
12111820Sjulian  extern bool JITEmitDebugInfo;
12211820Sjulian
12311820Sjulian  /// JITEmitDebugInfoToDisk - This flag indicates that the JIT should write
12411820Sjulian  /// the object files generated by the JITEmitDebugInfo flag to disk.  This
12511820Sjulian  /// flag is hidden and is only for debugging the debug info.
12611820Sjulian  extern bool JITEmitDebugInfoToDisk;
12711820Sjulian
12811820Sjulian  /// GuaranteedTailCallOpt - This flag is enabled when -tailcallopt is
12911820Sjulian  /// specified on the commandline. When the flag is on, participating targets
13011820Sjulian  /// will perform tail call optimization on all calls which use the fastcc
13111820Sjulian  /// calling convention and which satisfy certain target-independent
13211820Sjulian  /// criteria (being at the end of a function, having the same return type
13311820Sjulian  /// as their parent function, etc.), using an alternate ABI if necessary.
13411820Sjulian  extern bool GuaranteedTailCallOpt;
13511820Sjulian
13611820Sjulian  /// StackAlignmentOverride - Override default stack alignment for target.
13711820Sjulian  extern unsigned StackAlignmentOverride;
13811820Sjulian
13911820Sjulian  /// RealignStack - This flag indicates whether the stack should be
14011820Sjulian  /// automatically realigned, if needed.
14111820Sjulian  extern bool RealignStack;
14211820Sjulian
14311820Sjulian  /// DisableJumpTables - This flag indicates jump tables should not be
14411820Sjulian  /// generated.
14511820Sjulian  extern bool DisableJumpTables;
14611820Sjulian
14711820Sjulian  /// EnableFastISel - This flag enables fast-path instruction selection
14811820Sjulian  /// which trades away generated code quality in favor of reducing
14911820Sjulian  /// compile time.
15011820Sjulian  extern bool EnableFastISel;
15111820Sjulian
15211820Sjulian  /// StrongPHIElim - This flag enables more aggressive PHI elimination
15311820Sjulian  /// wth earlier copy coalescing.
15411820Sjulian  extern bool StrongPHIElim;
15511820Sjulian
15611820Sjulian  /// getTrapFunctionName - If this returns a non-empty string, this means isel
15711820Sjulian  /// should lower Intrinsic::trap to a call to the specified function name
15811820Sjulian  /// instead of an ISD::TRAP node.
15911820Sjulian  extern StringRef getTrapFunctionName();
16011820Sjulian
16111820Sjulian  extern bool EnableSegmentedStacks;
16211820Sjulian
16311820Sjulian} // End llvm namespace
16411820Sjulian
16511820Sjulian#endif
16611820Sjulian