TargetOptions.h revision 1797ed50f488f2030f9f9a0ac7426262abf5220a
15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//===-- llvm/Target/TargetOptions.h - Target Options ------------*- C++ -*-===// 25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// 35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// The LLVM Compiler Infrastructure 45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// 55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// This file is distributed under the University of Illinois Open Source 65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// License. See LICENSE.TXT for details. 75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// 85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//===----------------------------------------------------------------------===// 95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// 105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// This file defines command line option flags that are shared across various 115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// targets. 125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// 135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//===----------------------------------------------------------------------===// 145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#ifndef LLVM_TARGET_TARGETOPTIONS_H 165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define LLVM_TARGET_TARGETOPTIONS_H 175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace llvm { 195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Possible float ABI settings. Used with FloatABIType in TargetOptions.h. 205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) namespace FloatABI { 215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) enum ABIType { 225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) Default, // Target-specific (either soft of hard depending on triple, etc). 235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) Soft, // Soft float. 245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) Hard // Hard float. 255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) }; 265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) } 275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// PrintMachineCode - This flag is enabled when the -print-machineinstrs 295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// option is specified on the command line, and should enable debugging 305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// output from the code generator. 315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) extern bool PrintMachineCode; 325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// NoFramePointerElim - This flag is enabled when the -disable-fp-elim is 345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// specified on the command line. If the target supports the frame pointer 355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// elimination optimization, this option should disable it. 365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) extern bool NoFramePointerElim; 375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// LessPreciseFPMAD - This flag is enabled when the 395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// -enable-fp-mad is specified on the command line. When this flag is off 405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// (the default), the code generator is not allowed to generate mad 415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// (multiply add) if the result is "less precise" than doing those operations 425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// individually. 435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) extern bool LessPreciseFPMADOption; 445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) extern bool LessPreciseFPMAD(); 455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// NoExcessFPPrecision - This flag is enabled when the 475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// -disable-excess-fp-precision flag is specified on the command line. When 485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// this flag is off (the default), the code generator is allowed to produce 495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// results that are "more precise" than IEEE allows. This includes use of 505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// FMA-like operations and use of the X86 FP registers without rounding all 515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// over the place. 525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) extern bool NoExcessFPPrecision; 535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// UnsafeFPMath - This flag is enabled when the 555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// -enable-unsafe-fp-math flag is specified on the command line. When 565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// this flag is off (the default), the code generator is not allowed to 575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// produce results that are "less precise" than IEEE allows. This includes 585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// use of X86 instructions like FSIN and FCOS instead of libcalls. 595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// UnsafeFPMath implies FiniteOnlyFPMath and LessPreciseFPMAD. 605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) extern bool UnsafeFPMath; 615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// FiniteOnlyFPMath - This returns true when the -enable-finite-only-fp-math 635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// option is specified on the command line. If this returns false (default), 645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// the code generator is not allowed to assume that FP arithmetic arguments 655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// and results are never NaNs or +-Infs. 665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) extern bool FiniteOnlyFPMathOption; 675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) extern bool FiniteOnlyFPMath(); 685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// HonorSignDependentRoundingFPMath - This returns true when the 705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// -enable-sign-dependent-rounding-fp-math is specified. If this returns 715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// false (the default), the code generator is allowed to assume that the 725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// rounding behavior is the default (round-to-zero for all floating point to 735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// integer conversions, and round-to-nearest for all other arithmetic 745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// truncations). If this is enabled (set to true), the code generator must 755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// assume that the rounding mode may dynamically change. 765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) extern bool HonorSignDependentRoundingFPMathOption; 775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) extern bool HonorSignDependentRoundingFPMath(); 785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// UseSoftFloat - This flag is enabled when the -soft-float flag is specified 805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// on the command line. When this flag is on, the code generator will 815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// generate libcalls to the software floating point library instead of 825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// target FP instructions. 835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) extern bool UseSoftFloat; 845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// FloatABIType - This setting is set by -float-abi=xxx option is specfied 865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// on the command line. This setting may either be Default, Soft, or Hard. 875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// Default selects the target's default behavior. Soft selects the ABI for 885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// UseSoftFloat, but does not inidcate that FP hardware may not be used. 895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// Such a combination is unfortunately popular (e.g. arm-apple-darwin). 905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// Hard presumes that the normal FP ABI is used. 915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) extern FloatABI::ABIType FloatABIType; 925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// NoZerosInBSS - By default some codegens place zero-initialized data to 945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// .bss section. This flag disables such behaviour (necessary, e.g. for 955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// crt*.o compiling). 965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) extern bool NoZerosInBSS; 975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// DwarfExceptionHandling - This flag indicates that Dwarf exception 995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// information should be emitted. 1005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) extern bool DwarfExceptionHandling; 1015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// SjLjExceptionHandling - This flag indicates that SJLJ exception 1035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// information should be emitted. 1045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) extern bool SjLjExceptionHandling; 1055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// JITEmitDebugInfo - This flag indicates that the JIT should try to emit 1075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// debug information and notify a debugger about it. 1085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) extern bool JITEmitDebugInfo; 1095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// JITEmitDebugInfoToDisk - This flag indicates that the JIT should write 1115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// the object files generated by the JITEmitDebugInfo flag to disk. This 1125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// flag is hidden and is only for debugging the debug info. 1135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) extern bool JITEmitDebugInfoToDisk; 1145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// UnwindTablesMandatory - This flag indicates that unwind tables should 1165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// be emitted for all functions. 1175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) extern bool UnwindTablesMandatory; 1185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// GuaranteedTailCallOpt - This flag is enabled when -tailcallopt is 1205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// specified on the commandline. When the flag is on, participating targets 1215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// will perform tail call optimization on all calls which use the fastcc 1225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// calling convention and which satisfy certain target-independent 1235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// criteria (being at the end of a function, having the same return type 1245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// as their parent function, etc.), using an alternate ABI if necessary. 1255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) extern bool GuaranteedTailCallOpt; 1265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// StackAlignment - Override default stack alignment for target. 1285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) extern unsigned StackAlignment; 1295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// RealignStack - This flag indicates, whether stack should be automatically 1315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// realigned, if needed. 1325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) extern bool RealignStack; 1335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// DisableJumpTables - This flag indicates jump tables should not be 1355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// generated. 1365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) extern bool DisableJumpTables; 1375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// EnableFastISel - This flag enables fast-path instruction selection 1395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// which trades away generated code quality in favor of reducing 1405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// compile time. 1415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) extern bool EnableFastISel; 1425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// StrongPHIElim - This flag enables more aggressive PHI elimination 1445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// wth earlier copy coalescing. 1455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) extern bool StrongPHIElim; 1465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// DisableScheduling - This flag disables instruction scheduling. In 1485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// particular, it assigns an ordering to the SDNodes, which the scheduler 1495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) /// uses instead of its normal heuristics to perform scheduling. 1505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) extern bool DisableScheduling; 1515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} // End llvm namespace 1535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif 1555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)