1635ffcdf58f9bdc35c4ad4969fb35dc3659cf384Chris Lattner//===-- llvm/Target/TargetOptions.h - Target Options ------------*- C++ -*-===// 234695381d626485a560594f162701088079589dfMisha Brukman// 3635ffcdf58f9bdc35c4ad4969fb35dc3659cf384Chris Lattner// The LLVM Compiler Infrastructure 4635ffcdf58f9bdc35c4ad4969fb35dc3659cf384Chris Lattner// 57ed47a13356daed2a34cd2209a31f92552e3bdd8Chris Lattner// This file is distributed under the University of Illinois Open Source 67ed47a13356daed2a34cd2209a31f92552e3bdd8Chris Lattner// License. See LICENSE.TXT for details. 734695381d626485a560594f162701088079589dfMisha Brukman// 8635ffcdf58f9bdc35c4ad4969fb35dc3659cf384Chris Lattner//===----------------------------------------------------------------------===// 9635ffcdf58f9bdc35c4ad4969fb35dc3659cf384Chris Lattner// 10635ffcdf58f9bdc35c4ad4969fb35dc3659cf384Chris Lattner// This file defines command line option flags that are shared across various 11635ffcdf58f9bdc35c4ad4969fb35dc3659cf384Chris Lattner// targets. 12635ffcdf58f9bdc35c4ad4969fb35dc3659cf384Chris Lattner// 13635ffcdf58f9bdc35c4ad4969fb35dc3659cf384Chris Lattner//===----------------------------------------------------------------------===// 14635ffcdf58f9bdc35c4ad4969fb35dc3659cf384Chris Lattner 15635ffcdf58f9bdc35c4ad4969fb35dc3659cf384Chris Lattner#ifndef LLVM_TARGET_TARGETOPTIONS_H 16635ffcdf58f9bdc35c4ad4969fb35dc3659cf384Chris Lattner#define LLVM_TARGET_TARGETOPTIONS_H 17635ffcdf58f9bdc35c4ad4969fb35dc3659cf384Chris Lattner 188a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky#include <string> 198a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky 20635ffcdf58f9bdc35c4ad4969fb35dc3659cf384Chris Lattnernamespace llvm { 21e566763b1915c7a4821ce95937b763724d271fecEvan Cheng class MachineFunction; 2284a61269370138b68ae2bcd6711a9ae8004fd77aEli Friedman class StringRef; 23e566763b1915c7a4821ce95937b763724d271fecEvan Cheng 2405e5fcab0910b7e0ebdd03cb4c1960ae8ba219fdChris Lattner // Possible float ABI settings. Used with FloatABIType in TargetOptions.h. 2505e5fcab0910b7e0ebdd03cb4c1960ae8ba219fdChris Lattner namespace FloatABI { 2605e5fcab0910b7e0ebdd03cb4c1960ae8ba219fdChris Lattner enum ABIType { 27a04d6c948cd6f273f6146fdb95a76e3bc587b9d4Chad Rosier Default, // Target-specific (either soft or hard depending on triple,etc). 2805e5fcab0910b7e0ebdd03cb4c1960ae8ba219fdChris Lattner Soft, // Soft float. 2905e5fcab0910b7e0ebdd03cb4c1960ae8ba219fdChris Lattner Hard // Hard float. 3005e5fcab0910b7e0ebdd03cb4c1960ae8ba219fdChris Lattner }; 3105e5fcab0910b7e0ebdd03cb4c1960ae8ba219fdChris Lattner } 328a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky 33e0231413225cf47aaf3238bf21afd0d59025028dLang Hames namespace FPOpFusion { 34e0231413225cf47aaf3238bf21afd0d59025028dLang Hames enum FPOpFusionMode { 35e0231413225cf47aaf3238bf21afd0d59025028dLang Hames Fast, // Enable fusion of FP ops wherever it's profitable. 36e0231413225cf47aaf3238bf21afd0d59025028dLang Hames Standard, // Only allow fusion of 'blessed' ops (currently just fmuladd). 37e0231413225cf47aaf3238bf21afd0d59025028dLang Hames Strict // Never fuse FP-ops. 38e0231413225cf47aaf3238bf21afd0d59025028dLang Hames }; 39e0231413225cf47aaf3238bf21afd0d59025028dLang Hames } 40e0231413225cf47aaf3238bf21afd0d59025028dLang Hames 418a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky class TargetOptions { 428a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky public: 438a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky TargetOptions() 448a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky : PrintMachineCode(false), NoFramePointerElim(false), 458a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky NoFramePointerElimNonLeaf(false), LessPreciseFPMADOption(false), 46e0231413225cf47aaf3238bf21afd0d59025028dLang Hames UnsafeFPMath(false), NoInfsFPMath(false), 478a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky NoNaNsFPMath(false), HonorSignDependentRoundingFPMathOption(false), 488a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky UseSoftFloat(false), NoZerosInBSS(false), JITExceptionHandling(false), 498a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky JITEmitDebugInfo(false), JITEmitDebugInfoToDisk(false), 5022de16dc7582dac43429ce0dcb374604020c01f5Nick Lewycky GuaranteedTailCallOpt(false), DisableTailCalls(false), 51b09350d9a5639f55c46659b30be12a0c938378abChad Rosier StackAlignmentOverride(0), RealignStack(true), SSPBufferSize(0), 52b09350d9a5639f55c46659b30be12a0c938378abChad Rosier EnableFastISel(false), PositionIndependentExecutable(false), 53b09350d9a5639f55c46659b30be12a0c938378abChad Rosier EnableSegmentedStacks(false), UseInitArray(false), TrapFuncName(""), 54b09350d9a5639f55c46659b30be12a0c938378abChad Rosier FloatABIType(FloatABI::Default), AllowFPOpFusion(FPOpFusion::Standard) 558a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky {} 568a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky 578a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// PrintMachineCode - This flag is enabled when the -print-machineinstrs 588a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// option is specified on the command line, and should enable debugging 598a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// output from the code generator. 608a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky unsigned PrintMachineCode : 1; 618a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky 628a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// NoFramePointerElim - This flag is enabled when the -disable-fp-elim is 638a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// specified on the command line. If the target supports the frame pointer 648a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// elimination optimization, this option should disable it. 658a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky unsigned NoFramePointerElim : 1; 668a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky 678a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// NoFramePointerElimNonLeaf - This flag is enabled when the 688a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// -disable-non-leaf-fp-elim is specified on the command line. If the 698a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// target supports the frame pointer elimination optimization, this option 708a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// should disable it for non-leaf functions. 718a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky unsigned NoFramePointerElimNonLeaf : 1; 728a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky 738a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// DisableFramePointerElim - This returns true if frame pointer elimination 748a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// optimization should be disabled for the given machine function. 758a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky bool DisableFramePointerElim(const MachineFunction &MF) const; 768a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky 778a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// LessPreciseFPMAD - This flag is enabled when the 788a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// -enable-fp-mad is specified on the command line. When this flag is off 798a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// (the default), the code generator is not allowed to generate mad 808a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// (multiply add) if the result is "less precise" than doing those 818a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// operations individually. 828a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky unsigned LessPreciseFPMADOption : 1; 838a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky bool LessPreciseFPMAD() const; 848a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky 858a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// UnsafeFPMath - This flag is enabled when the 868a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// -enable-unsafe-fp-math flag is specified on the command line. When 878a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// this flag is off (the default), the code generator is not allowed to 888a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// produce results that are "less precise" than IEEE allows. This includes 898a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// use of X86 instructions like FSIN and FCOS instead of libcalls. 908a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// UnsafeFPMath implies LessPreciseFPMAD. 918a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky unsigned UnsafeFPMath : 1; 928a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky 938a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// NoInfsFPMath - This flag is enabled when the 948a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// -enable-no-infs-fp-math flag is specified on the command line. When 958a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// this flag is off (the default), the code generator is not allowed to 968a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// assume the FP arithmetic arguments and results are never +-Infs. 978a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky unsigned NoInfsFPMath : 1; 988a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky 998a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// NoNaNsFPMath - This flag is enabled when the 1008a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// -enable-no-nans-fp-math flag is specified on the command line. When 1018a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// this flag is off (the default), the code generator is not allowed to 1028a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// assume the FP arithmetic arguments and results are never NaNs. 1038a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky unsigned NoNaNsFPMath : 1; 1048a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky 1058a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// HonorSignDependentRoundingFPMath - This returns true when the 1068a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// -enable-sign-dependent-rounding-fp-math is specified. If this returns 1078a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// false (the default), the code generator is allowed to assume that the 1088a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// rounding behavior is the default (round-to-zero for all floating point 1098a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// to integer conversions, and round-to-nearest for all other arithmetic 1108a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// truncations). If this is enabled (set to true), the code generator must 1118a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// assume that the rounding mode may dynamically change. 1128a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky unsigned HonorSignDependentRoundingFPMathOption : 1; 1138a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky bool HonorSignDependentRoundingFPMath() const; 114b3fe88f8379c4c4193d5d84267ae1a304437f8faAndrew Trick 1158a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// UseSoftFloat - This flag is enabled when the -soft-float flag is 1168a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// specified on the command line. When this flag is on, the code generator 1178a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// will generate libcalls to the software floating point library instead of 1188a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// target FP instructions. 1198a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky unsigned UseSoftFloat : 1; 1208a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky 1218a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// NoZerosInBSS - By default some codegens place zero-initialized data to 1228a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// .bss section. This flag disables such behaviour (necessary, e.g. for 1238a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// crt*.o compiling). 1248a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky unsigned NoZerosInBSS : 1; 1258a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky 1268a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// JITExceptionHandling - This flag indicates that the JIT should emit 1278a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// exception handling information. 1288a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky unsigned JITExceptionHandling : 1; 1298a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky 1308a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// JITEmitDebugInfo - This flag indicates that the JIT should try to emit 1318a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// debug information and notify a debugger about it. 1328a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky unsigned JITEmitDebugInfo : 1; 1338a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky 1348a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// JITEmitDebugInfoToDisk - This flag indicates that the JIT should write 1358a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// the object files generated by the JITEmitDebugInfo flag to disk. This 1368a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// flag is hidden and is only for debugging the debug info. 1378a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky unsigned JITEmitDebugInfoToDisk : 1; 1388a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky 1398a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// GuaranteedTailCallOpt - This flag is enabled when -tailcallopt is 1408a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// specified on the commandline. When the flag is on, participating targets 1418a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// will perform tail call optimization on all calls which use the fastcc 1428a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// calling convention and which satisfy certain target-independent 1438a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// criteria (being at the end of a function, having the same return type 1448a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// as their parent function, etc.), using an alternate ABI if necessary. 1458a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky unsigned GuaranteedTailCallOpt : 1; 1468a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky 14722de16dc7582dac43429ce0dcb374604020c01f5Nick Lewycky /// DisableTailCalls - This flag controls whether we will use tail calls. 14822de16dc7582dac43429ce0dcb374604020c01f5Nick Lewycky /// Disabling them may be useful to maintain a correct call stack. 14922de16dc7582dac43429ce0dcb374604020c01f5Nick Lewycky unsigned DisableTailCalls : 1; 15022de16dc7582dac43429ce0dcb374604020c01f5Nick Lewycky 1518a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// StackAlignmentOverride - Override default stack alignment for target. 1528a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky unsigned StackAlignmentOverride; 1538a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky 1548a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// RealignStack - This flag indicates whether the stack should be 1558a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// automatically realigned, if needed. 1568a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky unsigned RealignStack : 1; 1578a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky 15835907e98626b33f6406dc498201fc59ced282c8aChad Rosier /// SSPBufferSize - The minimum size of buffers that will receive stack 15935907e98626b33f6406dc498201fc59ced282c8aChad Rosier /// smashing protection when -fstack-protection is used. 16035907e98626b33f6406dc498201fc59ced282c8aChad Rosier unsigned SSPBufferSize; 16135907e98626b33f6406dc498201fc59ced282c8aChad Rosier 1628a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// EnableFastISel - This flag enables fast-path instruction selection 1638a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// which trades away generated code quality in favor of reducing 1648a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// compile time. 1658a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky unsigned EnableFastISel : 1; 166b3fe88f8379c4c4193d5d84267ae1a304437f8faAndrew Trick 167253933ee9ef2c413ecd782efeacc5d7b9bcda09aChandler Carruth /// PositionIndependentExecutable - This flag indicates whether the code 168253933ee9ef2c413ecd782efeacc5d7b9bcda09aChandler Carruth /// will eventually be linked into a single executable, despite the PIC 169253933ee9ef2c413ecd782efeacc5d7b9bcda09aChandler Carruth /// relocation model being in use. It's value is undefined (and irrelevant) 170253933ee9ef2c413ecd782efeacc5d7b9bcda09aChandler Carruth /// if the relocation model is anything other than PIC. 171253933ee9ef2c413ecd782efeacc5d7b9bcda09aChandler Carruth unsigned PositionIndependentExecutable : 1; 172253933ee9ef2c413ecd782efeacc5d7b9bcda09aChandler Carruth 1738a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky unsigned EnableSegmentedStacks : 1; 1748a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky 175d6b43a317e71246380db55a50b799b062b53cdceRafael Espindola /// UseInitArray - Use .init_array instead of .ctors for static 176d6b43a317e71246380db55a50b799b062b53cdceRafael Espindola /// constructors. 177d6b43a317e71246380db55a50b799b062b53cdceRafael Espindola unsigned UseInitArray : 1; 178d6b43a317e71246380db55a50b799b062b53cdceRafael Espindola 1798a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// getTrapFunctionName - If this returns a non-empty string, this means 1808a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// isel should lower Intrinsic::trap to a call to the specified function 1818a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// name instead of an ISD::TRAP node. 1828a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky std::string TrapFuncName; 1838a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky StringRef getTrapFunctionName() const; 1848a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky 1858a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// FloatABIType - This setting is set by -float-abi=xxx option is specfied 1868a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// on the command line. This setting may either be Default, Soft, or Hard. 1878a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// Default selects the target's default behavior. Soft selects the ABI for 1888a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// UseSoftFloat, but does not indicate that FP hardware may not be used. 1898a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// Such a combination is unfortunately popular (e.g. arm-apple-darwin). 1908a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky /// Hard presumes that the normal FP ABI is used. 1918a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky FloatABI::ABIType FloatABIType; 192e0231413225cf47aaf3238bf21afd0d59025028dLang Hames 193e0231413225cf47aaf3238bf21afd0d59025028dLang Hames /// AllowFPOpFusion - This flag is set by the -fuse-fp-ops=xxx option. 194e0231413225cf47aaf3238bf21afd0d59025028dLang Hames /// This controls the creation of fused FP ops that store intermediate 195e0231413225cf47aaf3238bf21afd0d59025028dLang Hames /// results in higher precision than IEEE allows (E.g. FMAs). 196e0231413225cf47aaf3238bf21afd0d59025028dLang Hames /// 197e0231413225cf47aaf3238bf21afd0d59025028dLang Hames /// Fast mode - allows formation of fused FP ops whenever they're 198e0231413225cf47aaf3238bf21afd0d59025028dLang Hames /// profitable. 199e0231413225cf47aaf3238bf21afd0d59025028dLang Hames /// Standard mode - allow fusion only for 'blessed' FP ops. At present the 200e0231413225cf47aaf3238bf21afd0d59025028dLang Hames /// only blessed op is the fmuladd intrinsic. In the future more blessed ops 201e0231413225cf47aaf3238bf21afd0d59025028dLang Hames /// may be added. 202e0231413225cf47aaf3238bf21afd0d59025028dLang Hames /// Strict mode - allow fusion only if/when it can be proven that the excess 203e0231413225cf47aaf3238bf21afd0d59025028dLang Hames /// precision won't effect the result. 204e0231413225cf47aaf3238bf21afd0d59025028dLang Hames /// 205a04d6c948cd6f273f6146fdb95a76e3bc587b9d4Chad Rosier /// Note: This option only controls formation of fused ops by the 206a04d6c948cd6f273f6146fdb95a76e3bc587b9d4Chad Rosier /// optimizers. Fused operations that are explicitly specified (e.g. FMA 207a04d6c948cd6f273f6146fdb95a76e3bc587b9d4Chad Rosier /// via the llvm.fma.* intrinsic) will always be honored, regardless of 20833634833aa651cab5ea92b87822c038fb6e71778Chad Rosier /// the value of this option. 209e0231413225cf47aaf3238bf21afd0d59025028dLang Hames FPOpFusion::FPOpFusionMode AllowFPOpFusion; 210e0231413225cf47aaf3238bf21afd0d59025028dLang Hames 2118a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky }; 212635ffcdf58f9bdc35c4ad4969fb35dc3659cf384Chris Lattner} // End llvm namespace 213635ffcdf58f9bdc35c4ad4969fb35dc3659cf384Chris Lattner 214635ffcdf58f9bdc35c4ad4969fb35dc3659cf384Chris Lattner#endif 215