diff options
author | Duncan Sands <baldrick@free.fr> | 2009-09-26 15:35:35 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2009-09-26 15:35:35 +0000 |
commit | 129de48982b8c81af6912c63e9e58b2545efa773 (patch) | |
tree | e771ef59cdd9cfc54d195b5f282b6c8a7a953632 /llvm/include | |
parent | 832800aa6f8144ec4f002c3bcc94a54a02d06991 (diff) | |
download | bcm5719-llvm-129de48982b8c81af6912c63e9e58b2545efa773.tar.gz bcm5719-llvm-129de48982b8c81af6912c63e9e58b2545efa773.zip |
For the NSWSub support in the builder to actually be useable,
there need to be corresponding changes to the constant folders,
done in this patch.
llvm-svn: 82862
Diffstat (limited to 'llvm/include')
-rw-r--r-- | llvm/include/llvm/Constants.h | 1 | ||||
-rw-r--r-- | llvm/include/llvm/Support/ConstantFolder.h | 3 | ||||
-rw-r--r-- | llvm/include/llvm/Support/NoFolder.h | 3 | ||||
-rw-r--r-- | llvm/include/llvm/Support/TargetFolder.h | 3 |
4 files changed, 10 insertions, 0 deletions
diff --git a/llvm/include/llvm/Constants.h b/llvm/include/llvm/Constants.h index 4999998078b..260a89a2d38 100644 --- a/llvm/include/llvm/Constants.h +++ b/llvm/include/llvm/Constants.h @@ -654,6 +654,7 @@ public: static Constant *getBitCast (Constant *C, const Type *Ty); static Constant* getNSWAdd(Constant* C1, Constant* C2); + static Constant* getNSWSub(Constant* C1, Constant* C2); static Constant* getExactSDiv(Constant* C1, Constant* C2); /// Transparently provide more efficient getOperand methods. diff --git a/llvm/include/llvm/Support/ConstantFolder.h b/llvm/include/llvm/Support/ConstantFolder.h index 3c9278aaa7a..99cb92078f3 100644 --- a/llvm/include/llvm/Support/ConstantFolder.h +++ b/llvm/include/llvm/Support/ConstantFolder.h @@ -44,6 +44,9 @@ public: Constant *CreateSub(Constant *LHS, Constant *RHS) const { return ConstantExpr::getSub(LHS, RHS); } + Constant *CreateNSWSub(Constant *LHS, Constant *RHS) const { + return ConstantExpr::getNSWSub(LHS, RHS); + } Constant *CreateFSub(Constant *LHS, Constant *RHS) const { return ConstantExpr::getFSub(LHS, RHS); } diff --git a/llvm/include/llvm/Support/NoFolder.h b/llvm/include/llvm/Support/NoFolder.h index 4540f028cee..1f671c19250 100644 --- a/llvm/include/llvm/Support/NoFolder.h +++ b/llvm/include/llvm/Support/NoFolder.h @@ -51,6 +51,9 @@ public: Value *CreateSub(Constant *LHS, Constant *RHS) const { return BinaryOperator::CreateSub(LHS, RHS); } + Value *CreateNSWSub(Constant *LHS, Constant *RHS) const { + return BinaryOperator::CreateNSWSub(LHS, RHS); + } Value *CreateFSub(Constant *LHS, Constant *RHS) const { return BinaryOperator::CreateFSub(LHS, RHS); } diff --git a/llvm/include/llvm/Support/TargetFolder.h b/llvm/include/llvm/Support/TargetFolder.h index 77533c00b13..8e28632b7eb 100644 --- a/llvm/include/llvm/Support/TargetFolder.h +++ b/llvm/include/llvm/Support/TargetFolder.h @@ -60,6 +60,9 @@ public: Constant *CreateSub(Constant *LHS, Constant *RHS) const { return Fold(ConstantExpr::getSub(LHS, RHS)); } + Constant *CreateNSWSub(Constant *LHS, Constant *RHS) const { + return Fold(ConstantExpr::getNSWSub(LHS, RHS)); + } Constant *CreateFSub(Constant *LHS, Constant *RHS) const { return Fold(ConstantExpr::getFSub(LHS, RHS)); } |