Index: include/llvm/Analysis/TargetFolder.h =================================================================== --- include/llvm/Analysis/TargetFolder.h +++ include/llvm/Analysis/TargetFolder.h @@ -53,24 +53,27 @@ return Fold(ConstantExpr::getAdd(LHS, RHS, HasNUW, HasNSW)); } Constant *CreateFAdd(Constant *LHS, Constant *RHS, - FastMathFlags FMF = FastMathFlags()) const { - return Fold(ConstantExpr::getFAdd(LHS, RHS, FMF)); + FastMathFlags FMF = FastMathFlags(), + bool Strict = false) const { + return Fold(ConstantExpr::getFAdd(LHS, RHS, FMF, Strict)); } Constant *CreateSub(Constant *LHS, Constant *RHS, bool HasNUW = false, bool HasNSW = false) const { return Fold(ConstantExpr::getSub(LHS, RHS, HasNUW, HasNSW)); } Constant *CreateFSub(Constant *LHS, Constant *RHS, - FastMathFlags FMF = FastMathFlags()) const { - return Fold(ConstantExpr::getFSub(LHS, RHS, FMF)); + FastMathFlags FMF = FastMathFlags(), + bool Strict = false) const { + return Fold(ConstantExpr::getFSub(LHS, RHS, FMF, Strict)); } Constant *CreateMul(Constant *LHS, Constant *RHS, bool HasNUW = false, bool HasNSW = false) const { return Fold(ConstantExpr::getMul(LHS, RHS, HasNUW, HasNSW)); } Constant *CreateFMul(Constant *LHS, Constant *RHS, - FastMathFlags FMF = FastMathFlags()) const { - return Fold(ConstantExpr::getFMul(LHS, RHS, FMF)); + FastMathFlags FMF = FastMathFlags(), + bool Strict = false) const { + return Fold(ConstantExpr::getFMul(LHS, RHS, FMF, Strict)); } Constant *CreateUDiv(Constant *LHS, Constant *RHS, bool isExact = false)const{ return Fold(ConstantExpr::getUDiv(LHS, RHS, isExact)); @@ -79,8 +82,9 @@ return Fold(ConstantExpr::getSDiv(LHS, RHS, isExact)); } Constant *CreateFDiv(Constant *LHS, Constant *RHS, - FastMathFlags FMF = FastMathFlags()) const { - return Fold(ConstantExpr::getFDiv(LHS, RHS, FMF)); + FastMathFlags FMF = FastMathFlags(), + bool Strict = false) const { + return Fold(ConstantExpr::getFDiv(LHS, RHS, FMF, Strict)); } Constant *CreateURem(Constant *LHS, Constant *RHS) const { return Fold(ConstantExpr::getURem(LHS, RHS)); @@ -89,8 +93,9 @@ return Fold(ConstantExpr::getSRem(LHS, RHS)); } Constant *CreateFRem(Constant *LHS, Constant *RHS, - FastMathFlags FMF = FastMathFlags()) const { - return Fold(ConstantExpr::getFRem(LHS, RHS, FMF)); + FastMathFlags FMF = FastMathFlags(), + bool Strict = false) const { + return Fold(ConstantExpr::getFRem(LHS, RHS, FMF, Strict)); } Constant *CreateShl(Constant *LHS, Constant *RHS, bool HasNUW = false, bool HasNSW = false) const { Index: include/llvm/IR/ConstantFolder.h =================================================================== --- include/llvm/IR/ConstantFolder.h +++ include/llvm/IR/ConstantFolder.h @@ -37,24 +37,27 @@ return ConstantExpr::getAdd(LHS, RHS, HasNUW, HasNSW); } Constant *CreateFAdd(Constant *LHS, Constant *RHS, - FastMathFlags FMF = FastMathFlags()) const { - return ConstantExpr::getFAdd(LHS, RHS, FMF); + FastMathFlags FMF = FastMathFlags(), + bool Strict = false) const { + return ConstantExpr::getFAdd(LHS, RHS, FMF, Strict); } Constant *CreateSub(Constant *LHS, Constant *RHS, bool HasNUW = false, bool HasNSW = false) const { return ConstantExpr::getSub(LHS, RHS, HasNUW, HasNSW); } Constant *CreateFSub(Constant *LHS, Constant *RHS, - FastMathFlags FMF = FastMathFlags()) const { - return ConstantExpr::getFSub(LHS, RHS, FMF); + FastMathFlags FMF = FastMathFlags(), + bool Strict = false) const { + return ConstantExpr::getFSub(LHS, RHS, FMF, Strict); } Constant *CreateMul(Constant *LHS, Constant *RHS, bool HasNUW = false, bool HasNSW = false) const { return ConstantExpr::getMul(LHS, RHS, HasNUW, HasNSW); } Constant *CreateFMul(Constant *LHS, Constant *RHS, - FastMathFlags FMF = FastMathFlags()) const { - return ConstantExpr::getFMul(LHS, RHS, FMF); + FastMathFlags FMF = FastMathFlags(), + bool Strict = false) const { + return ConstantExpr::getFMul(LHS, RHS, FMF, Strict); } Constant *CreateUDiv(Constant *LHS, Constant *RHS, bool isExact = false) const { @@ -65,8 +68,9 @@ return ConstantExpr::getSDiv(LHS, RHS, isExact); } Constant *CreateFDiv(Constant *LHS, Constant *RHS, - FastMathFlags FMF = FastMathFlags()) const { - return ConstantExpr::getFDiv(LHS, RHS, FMF); + FastMathFlags FMF = FastMathFlags(), + bool Strict = false) const { + return ConstantExpr::getFDiv(LHS, RHS, FMF, Strict); } Constant *CreateURem(Constant *LHS, Constant *RHS) const { return ConstantExpr::getURem(LHS, RHS); @@ -75,8 +79,9 @@ return ConstantExpr::getSRem(LHS, RHS); } Constant *CreateFRem(Constant *LHS, Constant *RHS, - FastMathFlags FMF = FastMathFlags()) const { - return ConstantExpr::getFRem(LHS, RHS, FMF); + FastMathFlags FMF = FastMathFlags(), + bool Strict = false) const { + return ConstantExpr::getFRem(LHS, RHS, FMF, Strict); } Constant *CreateShl(Constant *LHS, Constant *RHS, bool HasNUW = false, bool HasNSW = false) const { Index: include/llvm/IR/Constants.h =================================================================== --- include/llvm/IR/Constants.h +++ include/llvm/IR/Constants.h @@ -921,23 +921,28 @@ static Constant *getAdd(Constant *C1, Constant *C2, bool HasNUW = false, bool HasNSW = false); static Constant *getFAdd(Constant *C1, Constant *C2, - FastMathFlags FMF = FastMathFlags()); + FastMathFlags FMF = FastMathFlags(), + bool Strict = false); static Constant *getSub(Constant *C1, Constant *C2, bool HasNUW = false, bool HasNSW = false); static Constant *getFSub(Constant *C1, Constant *C2, - FastMathFlags FMF = FastMathFlags()); + FastMathFlags FMF = FastMathFlags(), + bool Strict = false); static Constant *getMul(Constant *C1, Constant *C2, bool HasNUW = false, bool HasNSW = false); static Constant *getFMul(Constant *C1, Constant *C2, - FastMathFlags FMF = FastMathFlags()); + FastMathFlags FMF = FastMathFlags(), + bool Strict = false); static Constant *getUDiv(Constant *C1, Constant *C2, bool isExact = false); static Constant *getSDiv(Constant *C1, Constant *C2, bool isExact = false); static Constant *getFDiv(Constant *C1, Constant *C2, - FastMathFlags FMF = FastMathFlags()); + FastMathFlags FMF = FastMathFlags(), + bool Strict = false); static Constant *getURem(Constant *C1, Constant *C2); static Constant *getSRem(Constant *C1, Constant *C2); static Constant *getFRem(Constant *C1, Constant *C2, - FastMathFlags FMF = FastMathFlags()); + FastMathFlags FMF = FastMathFlags(), + bool Strict = false); static Constant *getAnd(Constant *C1, Constant *C2); static Constant *getOr(Constant *C1, Constant *C2); static Constant *getXor(Constant *C1, Constant *C2); Index: lib/IR/Constants.cpp =================================================================== --- lib/IR/Constants.cpp +++ lib/IR/Constants.cpp @@ -2223,8 +2223,9 @@ return get(Instruction::Add, C1, C2, Flags); } -Constant *ConstantExpr::getFAdd(Constant *C1, Constant *C2, FastMathFlags FMF) { - return get(Instruction::FAdd, C1, C2, FMF); +Constant *ConstantExpr::getFAdd(Constant *C1, Constant *C2, + FastMathFlags FMF, bool Strict) { + return get(Instruction::FAdd, C1, C2, FMF, Strict); } Constant *ConstantExpr::getSub(Constant *C1, Constant *C2, @@ -2234,8 +2235,9 @@ return get(Instruction::Sub, C1, C2, Flags); } -Constant *ConstantExpr::getFSub(Constant *C1, Constant *C2, FastMathFlags FMF) { - return get(Instruction::FSub, C1, C2, FMF); +Constant *ConstantExpr::getFSub(Constant *C1, Constant *C2, + FastMathFlags FMF, bool Strict) { + return get(Instruction::FSub, C1, C2, FMF, Strict); } Constant *ConstantExpr::getMul(Constant *C1, Constant *C2, @@ -2245,8 +2247,9 @@ return get(Instruction::Mul, C1, C2, Flags); } -Constant *ConstantExpr::getFMul(Constant *C1, Constant *C2, FastMathFlags FMF) { - return get(Instruction::FMul, C1, C2, FMF); +Constant *ConstantExpr::getFMul(Constant *C1, Constant *C2, + FastMathFlags FMF, bool Strict) { + return get(Instruction::FMul, C1, C2, FMF, Strict); } Constant *ConstantExpr::getUDiv(Constant *C1, Constant *C2, bool isExact) { @@ -2259,8 +2262,9 @@ isExact ? PossiblyExactOperator::IsExact : 0); } -Constant *ConstantExpr::getFDiv(Constant *C1, Constant *C2, FastMathFlags FMF) { - return get(Instruction::FDiv, C1, C2, FMF); +Constant *ConstantExpr::getFDiv(Constant *C1, Constant *C2, + FastMathFlags FMF, bool Strict) { + return get(Instruction::FDiv, C1, C2, FMF, Strict); } Constant *ConstantExpr::getURem(Constant *C1, Constant *C2) { @@ -2271,8 +2275,9 @@ return get(Instruction::SRem, C1, C2); } -Constant *ConstantExpr::getFRem(Constant *C1, Constant *C2, FastMathFlags FMF) { - return get(Instruction::FRem, C1, C2, FMF); +Constant *ConstantExpr::getFRem(Constant *C1, Constant *C2, + FastMathFlags FMF, bool Strict) { + return get(Instruction::FRem, C1, C2, FMF, Strict); } Constant *ConstantExpr::getAnd(Constant *C1, Constant *C2) {