diff options
author | Nate Begeman <natebegeman@mac.com> | 2008-05-14 20:29:46 +0000 |
---|---|---|
committer | Nate Begeman <natebegeman@mac.com> | 2008-05-14 20:29:46 +0000 |
commit | 0342049cd8bb77d76e3c76f441f986360e6637cf (patch) | |
tree | c7a261cb8db7bca7df679c061c3c333a1d72e3b1 | |
parent | 35213344672fb5215a36c8dd592a7cc7190445fa (diff) |
Add support to IR builder for new vicmp, vfcmp routines
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51127 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Support/IRBuilder.h | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/include/llvm/Support/IRBuilder.h b/include/llvm/Support/IRBuilder.h index c965cd3e13..e2610ea08c 100644 --- a/include/llvm/Support/IRBuilder.h +++ b/include/llvm/Support/IRBuilder.h @@ -446,21 +446,36 @@ public: return CreateFCmp(FCmpInst::FCMP_UNE, LHS, RHS, Name); } - Value *CreateICmp(ICmpInst::Predicate P, Value *LHS, Value *RHS, - const char *Name = "") { + Value *CreateICmp(CmpInst::Predicate P, Value *LHS, Value *RHS, + const char *Name = "") { if (Constant *LC = dyn_cast<Constant>(LHS)) if (Constant *RC = dyn_cast<Constant>(RHS)) return ConstantExpr::getCompare(P, LC, RC); return Insert(new ICmpInst(P, LHS, RHS, Name)); } - Value *CreateFCmp(FCmpInst::Predicate P, Value *LHS, Value *RHS, - const char *Name = "") { + Value *CreateFCmp(CmpInst::Predicate P, Value *LHS, Value *RHS, + const char *Name = "") { if (Constant *LC = dyn_cast<Constant>(LHS)) if (Constant *RC = dyn_cast<Constant>(RHS)) return ConstantExpr::getCompare(P, LC, RC); return Insert(new FCmpInst(P, LHS, RHS, Name)); } + Value *CreateVICmp(CmpInst::Predicate P, Value *LHS, Value *RHS, + const char *Name = "") { + if (Constant *LC = dyn_cast<Constant>(LHS)) + if (Constant *RC = dyn_cast<Constant>(RHS)) + return ConstantExpr::getCompare(P, LC, RC); + return Insert(new VICmpInst(P, LHS, RHS, Name)); + } + Value *CreateVFCmp(CmpInst::Predicate P, Value *LHS, Value *RHS, + const char *Name = "") { + if (Constant *LC = dyn_cast<Constant>(LHS)) + if (Constant *RC = dyn_cast<Constant>(RHS)) + return ConstantExpr::getCompare(P, LC, RC); + return Insert(new VFCmpInst(P, LHS, RHS, Name)); + } + //===--------------------------------------------------------------------===// // Instruction creation methods: Other Instructions //===--------------------------------------------------------------------===// |