aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-12-18 03:10:26 +0000
committerDan Gohman <gohman@apple.com>2009-12-18 03:10:26 +0000
commit411984810e4a66591123e1b16873e5f19ae18817 (patch)
tree1096f23be5ece8717b0a6b5602649af6baac7133 /lib
parentbdc46c6af5ffcf3596a72df75880fe8703436060 (diff)
downloadexternal_llvm-411984810e4a66591123e1b16873e5f19ae18817.zip
external_llvm-411984810e4a66591123e1b16873e5f19ae18817.tar.gz
external_llvm-411984810e4a66591123e1b16873e5f19ae18817.tar.bz2
Add utility routines for NSW multiply.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91664 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/VMCore/Constants.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp
index 2507402..34fc9a8 100644
--- a/lib/VMCore/Constants.cpp
+++ b/lib/VMCore/Constants.cpp
@@ -643,6 +643,11 @@ Constant* ConstantExpr::getNSWSub(Constant* C1, Constant* C2) {
OverflowingBinaryOperator::NoSignedWrap);
}
+Constant* ConstantExpr::getNSWMul(Constant* C1, Constant* C2) {
+ return getTy(C1->getType(), Instruction::Mul, C1, C2,
+ OverflowingBinaryOperator::NoSignedWrap);
+}
+
Constant* ConstantExpr::getExactSDiv(Constant* C1, Constant* C2) {
return getTy(C1->getType(), Instruction::SDiv, C1, C2,
SDivOperator::IsExact);