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 | 7402017b9aafae35ca3b9ec48c09cb61755ca614 (patch) | |
| tree | 299d98f674d6041271805662e1d6f1ef9148e4a6 | |
| parent | 0f7fb95e795b1afd5f4aa7a66c97a889e2583e65 (diff) | |
| download | bcm5719-llvm-7402017b9aafae35ca3b9ec48c09cb61755ca614.tar.gz bcm5719-llvm-7402017b9aafae35ca3b9ec48c09cb61755ca614.zip | |
Add support to IR builder for new vicmp, vfcmp routines
llvm-svn: 51127
| -rw-r--r-- | llvm/include/llvm/Support/IRBuilder.h | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/llvm/include/llvm/Support/IRBuilder.h b/llvm/include/llvm/Support/IRBuilder.h index c965cd3e13b..e2610ea08cf 100644 --- a/llvm/include/llvm/Support/IRBuilder.h +++ b/llvm/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 //===--------------------------------------------------------------------===// |

