Index: include/llvm/CodeGen/SelectionDAGNodes.h =================================================================== --- include/llvm/CodeGen/SelectionDAGNodes.h +++ include/llvm/CodeGen/SelectionDAGNodes.h @@ -328,6 +328,8 @@ bool NoInfs : 1; bool NoSignedZeros : 1; bool AllowReciprocal : 1; + bool KeepExceptions : 1; + bool KeepRounding : 1; public: /// Default constructor turns off all optimization flags. @@ -340,6 +342,8 @@ NoInfs = false; NoSignedZeros = false; AllowReciprocal = false; + KeepExceptions = false; + KeepRounding = false; } // These are mutators for each flag. @@ -351,6 +355,8 @@ void setNoInfs(bool b) { NoInfs = b; } void setNoSignedZeros(bool b) { NoSignedZeros = b; } void setAllowReciprocal(bool b) { AllowReciprocal = b; } + void setKeepExceptions(bool b) { KeepExceptions = b; } + void setKeepRounding(bool b) { KeepRounding = b; } // These are accessors for each flag. bool hasNoUnsignedWrap() const { return NoUnsignedWrap; } @@ -361,13 +367,16 @@ bool hasNoInfs() const { return NoInfs; } bool hasNoSignedZeros() const { return NoSignedZeros; } bool hasAllowReciprocal() const { return AllowReciprocal; } + bool hasKeepExceptions() const { return KeepExceptions; } + bool hasKeepRounding() const { return KeepRounding; } /// Return a raw encoding of the flags. /// This function should only be used to add data to the NodeID value. unsigned getRawFlags() const { return (NoUnsignedWrap << 0) | (NoSignedWrap << 1) | (Exact << 2) | (UnsafeAlgebra << 3) | (NoNaNs << 4) | (NoInfs << 5) | - (NoSignedZeros << 6) | (AllowReciprocal << 7); + (NoSignedZeros << 6) | (AllowReciprocal << 7) | + (KeepExceptions << 8) | (KeepRounding << 9); } }; Index: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp =================================================================== --- lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -2329,6 +2329,8 @@ Flags.setNoNaNs(FMF.noNaNs()); Flags.setNoSignedZeros(FMF.noSignedZeros()); Flags.setUnsafeAlgebra(FMF.unsafeAlgebra()); + Flags.setKeepExceptions(FMF.keepExceptions()); + Flags.setKeepRounding(FMF.keepRounding()); } SDValue BinNodeValue = DAG.getNode(OpCode, getCurSDLoc(), Op1.getValueType(), Op1, Op2, &Flags);