diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 3 | ||||
-rw-r--r-- | lib/Target/TargetMachine.cpp | 12 |
2 files changed, 11 insertions, 4 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 2e1f872c8a..cae696354f 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -1105,8 +1105,7 @@ void SelectionDAGLowering::visitSetCC(User &I,ISD::CondCode SignedOpcode, SDOperand Op1 = getValue(I.getOperand(0)); SDOperand Op2 = getValue(I.getOperand(1)); ISD::CondCode Opcode = SignedOpcode; - if ((!UnsafeFPMath && !FiniteOnlyFPMath) && - I.getOperand(0)->getType()->isFloatingPoint()) + if (!FiniteOnlyFPMath() && I.getOperand(0)->getType()->isFloatingPoint()) Opcode = FPOpcode; else if (I.getOperand(0)->getType()->isUnsigned()) Opcode = UnsignedOpcode; diff --git a/lib/Target/TargetMachine.cpp b/lib/Target/TargetMachine.cpp index 28f3ae88a7..bf70d12a6b 100644 --- a/lib/Target/TargetMachine.cpp +++ b/lib/Target/TargetMachine.cpp @@ -26,7 +26,7 @@ namespace llvm { bool NoFramePointerElim; bool NoExcessFPPrecision; bool UnsafeFPMath; - bool FiniteOnlyFPMath; + bool FiniteOnlyFPMathOption; Reloc::Model RelocationModel; }; namespace { @@ -52,7 +52,7 @@ namespace { cl::opt<bool, true> EnableFiniteOnltFPMath("enable-finite-only-fp-math", cl::desc("Enable optimizations that assumes non- NaNs / +-Infs"), - cl::location(FiniteOnlyFPMath), + cl::location(FiniteOnlyFPMathOption), cl::init(false)); cl::opt<llvm::Reloc::Model, true> DefRelocationModel( @@ -93,3 +93,11 @@ Reloc::Model TargetMachine::getRelocationModel() { void TargetMachine::setRelocationModel(Reloc::Model Model) { RelocationModel = Model; } + +namespace llvm { + /// FiniteOnlyFPMath - This returns true when the -enable-finite-only-fp-math + /// option is specified on the command line. If this returns false (default), + /// the code generator is not allowed to assume that FP arithmetic arguments + /// and results are never NaNs or +-Infs. + bool FiniteOnlyFPMath() { return UnsafeFPMath || FiniteOnlyFPMathOption; } +}; |