diff --git a/include/llvm/Support/IRBuilder.h b/include/llvm/Support/IRBuilder.h index c965cd3e13b..e2610ea08cf 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(LHS)) if (Constant *RC = dyn_cast(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(LHS)) if (Constant *RC = dyn_cast(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(LHS)) + if (Constant *RC = dyn_cast(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(LHS)) + if (Constant *RC = dyn_cast(RHS)) + return ConstantExpr::getCompare(P, LC, RC); + return Insert(new VFCmpInst(P, LHS, RHS, Name)); + } + //===--------------------------------------------------------------------===// // Instruction creation methods: Other Instructions //===--------------------------------------------------------------------===//