diff options
author | Chris Lattner <sabre@nondot.org> | 2011-02-09 16:44:36 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-02-09 16:44:36 +0000 |
commit | abcf9d58f2469db18f71c328c2976c0ed08c200a (patch) | |
tree | c2068ce6da8ad4cfc19d8d3957dbab25d0dee16a | |
parent | 0d75eac3504faa26bae730577e63c002928b5900 (diff) | |
download | bcm5719-llvm-abcf9d58f2469db18f71c328c2976c0ed08c200a.tar.gz bcm5719-llvm-abcf9d58f2469db18f71c328c2976c0ed08c200a.zip |
enrich folder interfaces around exactness.
llvm-svn: 125191
-rw-r--r-- | llvm/include/llvm/Support/ConstantFolder.h | 26 | ||||
-rw-r--r-- | llvm/include/llvm/Support/TargetFolder.h | 22 |
2 files changed, 20 insertions, 28 deletions
diff --git a/llvm/include/llvm/Support/ConstantFolder.h b/llvm/include/llvm/Support/ConstantFolder.h index 93adb3a403d..e56d3f6bce9 100644 --- a/llvm/include/llvm/Support/ConstantFolder.h +++ b/llvm/include/llvm/Support/ConstantFolder.h @@ -69,17 +69,13 @@ public: Constant *CreateFMul(Constant *LHS, Constant *RHS) const { return ConstantExpr::getFMul(LHS, RHS); } - Constant *CreateUDiv(Constant *LHS, Constant *RHS) const { - return ConstantExpr::getUDiv(LHS, RHS); + Constant *CreateUDiv(Constant *LHS, Constant *RHS, + bool isExact = false) const { + return ConstantExpr::getUDiv(LHS, RHS, isExact); } - Constant *CreateExactUDiv(Constant *LHS, Constant *RHS) const { - return ConstantExpr::getExactUDiv(LHS, RHS); - } - Constant *CreateSDiv(Constant *LHS, Constant *RHS) const { - return ConstantExpr::getSDiv(LHS, RHS); - } - Constant *CreateExactSDiv(Constant *LHS, Constant *RHS) const { - return ConstantExpr::getExactSDiv(LHS, RHS); + Constant *CreateSDiv(Constant *LHS, Constant *RHS, + bool isExact = false) const { + return ConstantExpr::getSDiv(LHS, RHS, isExact); } Constant *CreateFDiv(Constant *LHS, Constant *RHS) const { return ConstantExpr::getFDiv(LHS, RHS); @@ -96,11 +92,13 @@ public: Constant *CreateShl(Constant *LHS, Constant *RHS) const { return ConstantExpr::getShl(LHS, RHS); } - Constant *CreateLShr(Constant *LHS, Constant *RHS) const { - return ConstantExpr::getLShr(LHS, RHS); + Constant *CreateLShr(Constant *LHS, Constant *RHS, + bool isExact = false) const { + return ConstantExpr::getLShr(LHS, RHS, isExact); } - Constant *CreateAShr(Constant *LHS, Constant *RHS) const { - return ConstantExpr::getAShr(LHS, RHS); + Constant *CreateAShr(Constant *LHS, Constant *RHS, + bool isExact = false) const { + return ConstantExpr::getAShr(LHS, RHS, isExact); } Constant *CreateAnd(Constant *LHS, Constant *RHS) const { return ConstantExpr::getAnd(LHS, RHS); diff --git a/llvm/include/llvm/Support/TargetFolder.h b/llvm/include/llvm/Support/TargetFolder.h index 138885d48d1..efae4b1e3b4 100644 --- a/llvm/include/llvm/Support/TargetFolder.h +++ b/llvm/include/llvm/Support/TargetFolder.h @@ -82,17 +82,11 @@ public: Constant *CreateFMul(Constant *LHS, Constant *RHS) const { return Fold(ConstantExpr::getFMul(LHS, RHS)); } - Constant *CreateUDiv(Constant *LHS, Constant *RHS) const { - return Fold(ConstantExpr::getUDiv(LHS, RHS)); + Constant *CreateUDiv(Constant *LHS, Constant *RHS, bool isExact = false)const{ + return Fold(ConstantExpr::getUDiv(LHS, RHS, isExact)); } - Constant *CreateExactUDiv(Constant *LHS, Constant *RHS) const { - return Fold(ConstantExpr::getExactUDiv(LHS, RHS)); - } - Constant *CreateSDiv(Constant *LHS, Constant *RHS) const { - return Fold(ConstantExpr::getSDiv(LHS, RHS)); - } - Constant *CreateExactSDiv(Constant *LHS, Constant *RHS) const { - return Fold(ConstantExpr::getExactSDiv(LHS, RHS)); + Constant *CreateSDiv(Constant *LHS, Constant *RHS, bool isExact = false)const{ + return Fold(ConstantExpr::getSDiv(LHS, RHS, isExact)); } Constant *CreateFDiv(Constant *LHS, Constant *RHS) const { return Fold(ConstantExpr::getFDiv(LHS, RHS)); @@ -109,11 +103,11 @@ public: Constant *CreateShl(Constant *LHS, Constant *RHS) const { return Fold(ConstantExpr::getShl(LHS, RHS)); } - Constant *CreateLShr(Constant *LHS, Constant *RHS) const { - return Fold(ConstantExpr::getLShr(LHS, RHS)); + Constant *CreateLShr(Constant *LHS, Constant *RHS, bool isExact = false)const{ + return Fold(ConstantExpr::getLShr(LHS, RHS, isExact)); } - Constant *CreateAShr(Constant *LHS, Constant *RHS) const { - return Fold(ConstantExpr::getAShr(LHS, RHS)); + Constant *CreateAShr(Constant *LHS, Constant *RHS, bool isExact = false)const{ + return Fold(ConstantExpr::getAShr(LHS, RHS, isExact)); } Constant *CreateAnd(Constant *LHS, Constant *RHS) const { return Fold(ConstantExpr::getAnd(LHS, RHS)); |