diff options
| author | Dan Gohman <gohman@apple.com> | 2010-02-01 16:38:14 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2010-02-01 16:38:14 +0000 |
| commit | de047f2051151443c5a0a3deecb0b3e7e826376c (patch) | |
| tree | de431edd53508497c55f987fb0b0e51b97e2475f | |
| parent | ede94e68501ead5d92fb04e9d9fa5c2ec9c3e55c (diff) | |
| download | bcm5719-llvm-de047f2051151443c5a0a3deecb0b3e7e826376c.tar.gz bcm5719-llvm-de047f2051151443c5a0a3deecb0b3e7e826376c.zip | |
Add a getNUWMul function.
llvm-svn: 94982
| -rw-r--r-- | llvm/include/llvm/Constants.h | 1 | ||||
| -rw-r--r-- | llvm/lib/VMCore/Constants.cpp | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/llvm/include/llvm/Constants.h b/llvm/include/llvm/Constants.h index 4111f36c5f0..4b356067998 100644 --- a/llvm/include/llvm/Constants.h +++ b/llvm/include/llvm/Constants.h @@ -699,6 +699,7 @@ public: static Constant *getNSWNeg(Constant *C); static Constant *getNSWAdd(Constant *C1, Constant *C2); static Constant *getNSWSub(Constant *C1, Constant *C2); + static Constant *getNUWMul(Constant *C1, Constant *C2); static Constant *getNSWMul(Constant *C1, Constant *C2); static Constant *getExactSDiv(Constant *C1, Constant *C2); diff --git a/llvm/lib/VMCore/Constants.cpp b/llvm/lib/VMCore/Constants.cpp index b1c942c214f..ad654ee7968 100644 --- a/llvm/lib/VMCore/Constants.cpp +++ b/llvm/lib/VMCore/Constants.cpp @@ -656,6 +656,11 @@ Constant* ConstantExpr::getNSWSub(Constant* C1, Constant* C2) { OverflowingBinaryOperator::NoSignedWrap); } +Constant* ConstantExpr::getNUWMul(Constant* C1, Constant* C2) { + return getTy(C1->getType(), Instruction::Mul, C1, C2, + OverflowingBinaryOperator::NoUnsignedWrap); +} + Constant* ConstantExpr::getNSWMul(Constant* C1, Constant* C2) { return getTy(C1->getType(), Instruction::Mul, C1, C2, OverflowingBinaryOperator::NoSignedWrap); |

