diff options
| author | Dan Gohman <gohman@apple.com> | 2009-12-18 03:10:26 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2009-12-18 03:10:26 +0000 |
| commit | 4e3b29e309454790838e96749cfe49c0b7c07ad8 (patch) | |
| tree | 5a15104a669ce89ed2ecdaa29cbf979d3fa0ad46 /llvm/lib | |
| parent | 4ab4420d7a402c8ecd02540c0bb5a50073dcf8c8 (diff) | |
| download | bcm5719-llvm-4e3b29e309454790838e96749cfe49c0b7c07ad8.tar.gz bcm5719-llvm-4e3b29e309454790838e96749cfe49c0b7c07ad8.zip | |
Add utility routines for NSW multiply.
llvm-svn: 91664
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/VMCore/Constants.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Constants.cpp b/llvm/lib/VMCore/Constants.cpp index 2507402f899..34fc9a8ea4f 100644 --- a/llvm/lib/VMCore/Constants.cpp +++ b/llvm/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); |

