diff --git a/llvm/include/llvm/IR/IRBuilder.h b/llvm/include/llvm/IR/IRBuilder.h index 8525e2e8ebc02..10f2d72817e6b 100644 --- a/llvm/include/llvm/IR/IRBuilder.h +++ b/llvm/include/llvm/IR/IRBuilder.h @@ -1534,6 +1534,18 @@ class IRBuilderBase { return Insert(BinOp, Name); } + Value *CreateLogicalAnd(Value *Cond1, Value *Cond2, const Twine &Name = "") { + assert(Cond2->getType()->isIntOrIntVectorTy(1)); + return CreateSelect(Cond1, Cond2, + ConstantInt::getNullValue(Cond2->getType()), Name); + } + + Value *CreateLogicalOr(Value *Cond1, Value *Cond2, const Twine &Name = "") { + assert(Cond2->getType()->isIntOrIntVectorTy(1)); + return CreateSelect(Cond1, ConstantInt::getAllOnesValue(Cond2->getType()), + Cond2, Name); + } + CallInst *CreateConstrainedFPBinOp( Intrinsic::ID ID, Value *L, Value *R, Instruction *FMFSource = nullptr, const Twine &Name = "", MDNode *FPMathTag = nullptr,