diff options
author | Duncan Sands <baldrick@free.fr> | 2010-02-02 12:53:04 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2010-02-02 12:53:04 +0000 |
commit | 8991d51ddcea31e198aff1fd01c05af2679ee8f8 (patch) | |
tree | 09ee28307520a9d70966506f399eb0a0fa256335 /include/llvm/InstrTypes.h | |
parent | 769e2ad872538a203072ecdbb1ad9249a711a0d4 (diff) | |
download | llvm-8991d51ddcea31e198aff1fd01c05af2679ee8f8.tar.gz llvm-8991d51ddcea31e198aff1fd01c05af2679ee8f8.tar.bz2 llvm-8991d51ddcea31e198aff1fd01c05af2679ee8f8.tar.xz |
Adding missing methods for creating Add, Mul, Neg and Sub with NUW.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95086 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/InstrTypes.h')
-rw-r--r-- | include/llvm/InstrTypes.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/llvm/InstrTypes.h b/include/llvm/InstrTypes.h index b5cc65962e..5ce1a9df45 100644 --- a/include/llvm/InstrTypes.h +++ b/include/llvm/InstrTypes.h @@ -299,6 +299,27 @@ public: return BO; } + /// CreateNUWMul - Create a Mul operator with the NUW flag set. + /// + static BinaryOperator *CreateNUWMul(Value *V1, Value *V2, + const Twine &Name = "") { + BinaryOperator *BO = CreateMul(V1, V2, Name); + BO->setHasNoUnsignedWrap(true); + return BO; + } + static BinaryOperator *CreateNUWMul(Value *V1, Value *V2, + const Twine &Name, BasicBlock *BB) { + BinaryOperator *BO = CreateMul(V1, V2, Name, BB); + BO->setHasNoUnsignedWrap(true); + return BO; + } + static BinaryOperator *CreateNUWMul(Value *V1, Value *V2, + const Twine &Name, Instruction *I) { + BinaryOperator *BO = CreateMul(V1, V2, Name, I); + BO->setHasNoUnsignedWrap(true); + return BO; + } + /// CreateExactSDiv - Create an SDiv operator with the exact flag set. /// static BinaryOperator *CreateExactSDiv(Value *V1, Value *V2, @@ -334,6 +355,10 @@ public: Instruction *InsertBefore = 0); static BinaryOperator *CreateNSWNeg(Value *Op, const Twine &Name, BasicBlock *InsertAtEnd); + static BinaryOperator *CreateNUWNeg(Value *Op, const Twine &Name = "", + Instruction *InsertBefore = 0); + static BinaryOperator *CreateNUWNeg(Value *Op, const Twine &Name, + BasicBlock *InsertAtEnd); static BinaryOperator *CreateFNeg(Value *Op, const Twine &Name = "", Instruction *InsertBefore = 0); static BinaryOperator *CreateFNeg(Value *Op, const Twine &Name, |