Fix build post-revert in 8d5a981a135a
authorMehdi Amini <joker.eph@gmail.com>
Mon, 8 Mar 2021 00:57:36 +0000 (00:57 +0000)
committerMehdi Amini <joker.eph@gmail.com>
Mon, 8 Mar 2021 00:59:05 +0000 (00:59 +0000)
One commit introduced after the reverted change was using an API
introduced there, this is reintroducing the API, but not the original
broken change.

llvm/include/llvm/IR/IRBuilder.h

index 8525e2e..10f2d72 100644 (file)
@@ -1534,6 +1534,18 @@ public:
     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,