aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Target/TargetOptions.h
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2012-06-22 01:09:09 +0000
committerLang Hames <lhames@gmail.com>2012-06-22 01:09:09 +0000
commite0231413225cf47aaf3238bf21afd0d59025028d (patch)
tree74bd6f76ad54db548971d2a369ef1529ca6a11c7 /include/llvm/Target/TargetOptions.h
parent070b8dba809dd75267327cc823118bf7e171d17d (diff)
downloadexternal_llvm-e0231413225cf47aaf3238bf21afd0d59025028d.tar.gz
external_llvm-e0231413225cf47aaf3238bf21afd0d59025028d.tar.bz2
external_llvm-e0231413225cf47aaf3238bf21afd0d59025028d.zip
Rename -allow-excess-fp-precision flag to -fuse-fp-ops, and switch from a
boolean flag to an enum: { Fast, Standard, Strict } (default = Standard). This option controls the creation by optimizations of fused FP ops that store intermediate results in higher precision than IEEE allows (E.g. FMAs). The behavior of this option is intended to match the behaviour specified by a soon-to-be-introduced frontend flag: '-ffuse-fp-ops'. Fast mode - allows formation of fused FP ops whenever they're profitable. Standard mode - allow fusion only for 'blessed' FP ops. At present the only blessed op is the fmuladd intrinsic. In the future more blessed ops may be added. Strict mode - allow fusion only if/when it can be proven that the excess precision won't effect the result. Note: This option only controls formation of fused ops by the optimizers. Fused operations that are explicitly requested (e.g. FMA via the llvm.fma.* intrinsic) will always be honored, regardless of the value of this option. Internally TargetOptions::AllowExcessFPPrecision has been replaced by TargetOptions::AllowFPOpFusion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158956 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target/TargetOptions.h')
-rw-r--r--include/llvm/Target/TargetOptions.h40
1 files changed, 30 insertions, 10 deletions
diff --git a/include/llvm/Target/TargetOptions.h b/include/llvm/Target/TargetOptions.h
index 84287fb5d7..3a1809a80a 100644
--- a/include/llvm/Target/TargetOptions.h
+++ b/include/llvm/Target/TargetOptions.h
@@ -30,12 +30,20 @@ namespace llvm {
};
}
+ namespace FPOpFusion {
+ enum FPOpFusionMode {
+ Fast, // Enable fusion of FP ops wherever it's profitable.
+ Standard, // Only allow fusion of 'blessed' ops (currently just fmuladd).
+ Strict // Never fuse FP-ops.
+ };
+ }
+
class TargetOptions {
public:
TargetOptions()
: PrintMachineCode(false), NoFramePointerElim(false),
NoFramePointerElimNonLeaf(false), LessPreciseFPMADOption(false),
- AllowExcessFPPrecision(false), UnsafeFPMath(false), NoInfsFPMath(false),
+ UnsafeFPMath(false), NoInfsFPMath(false),
NoNaNsFPMath(false), HonorSignDependentRoundingFPMathOption(false),
UseSoftFloat(false), NoZerosInBSS(false), JITExceptionHandling(false),
JITEmitDebugInfo(false), JITEmitDebugInfoToDisk(false),
@@ -43,7 +51,8 @@ namespace llvm {
StackAlignmentOverride(0), RealignStack(true),
DisableJumpTables(false), EnableFastISel(false),
PositionIndependentExecutable(false), EnableSegmentedStacks(false),
- UseInitArray(false), TrapFuncName(""), FloatABIType(FloatABI::Default)
+ UseInitArray(false), TrapFuncName(""), FloatABIType(FloatABI::Default),
+ AllowFPOpFusion(FPOpFusion::Standard)
{}
/// PrintMachineCode - This flag is enabled when the -print-machineinstrs
@@ -74,14 +83,6 @@ namespace llvm {
unsigned LessPreciseFPMADOption : 1;
bool LessPreciseFPMAD() const;
- /// AllowExcessFPPrecision - This flag is enabled when the
- /// -enable-excess-fp-precision flag is specified on the command line. This
- /// flag is OFF by default. When it is turned on, the code generator is
- /// allowed to produce results that are "more precise" than IEEE allows.
- /// This includes use of FMA-like operations and use of the X86 FP registers
- /// without rounding all over the place.
- unsigned AllowExcessFPPrecision : 1;
-
/// UnsafeFPMath - This flag is enabled when the
/// -enable-unsafe-fp-math flag is specified on the command line. When
/// this flag is off (the default), the code generator is not allowed to
@@ -189,6 +190,25 @@ namespace llvm {
/// Such a combination is unfortunately popular (e.g. arm-apple-darwin).
/// Hard presumes that the normal FP ABI is used.
FloatABI::ABIType FloatABIType;
+
+ /// AllowFPOpFusion - This flag is set by the -fuse-fp-ops=xxx option.
+ /// This controls the creation of fused FP ops that store intermediate
+ /// results in higher precision than IEEE allows (E.g. FMAs).
+ ///
+ /// Fast mode - allows formation of fused FP ops whenever they're
+ /// profitable.
+ /// Standard mode - allow fusion only for 'blessed' FP ops. At present the
+ /// only blessed op is the fmuladd intrinsic. In the future more blessed ops
+ /// may be added.
+ /// Strict mode - allow fusion only if/when it can be proven that the excess
+ /// precision won't effect the result.
+ ///
+ /// Note: This option only controls formation of fused ops by the optimizers.
+ /// Fused operations that are explicitly specified (e.g. FMA via the
+ /// llvm.fma.* intrinsic) will always be honored, regardless of the value of
+ /// this option.
+ FPOpFusion::FPOpFusionMode AllowFPOpFusion;
+
};
} // End llvm namespace