Skip to content

Commit 8fb1799

Browse files
committed
[LLVMCore] Add new functions 'CreateNand'&'CreateNor'
1 parent 50ee758 commit 8fb1799

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

llvm/include/llvm/IR/IRBuilder.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,6 +1746,16 @@ class IRBuilderBase {
17461746
return CreateXor(V, Constant::getAllOnesValue(V->getType()), Name);
17471747
}
17481748

1749+
// Not(a And b)
1750+
Value *CreateNand(Value *LHS, Value *RHS, const Twine &Name = "") {
1751+
return CreateNot(CreateAnd(LHS, RHS), Name);
1752+
}
1753+
1754+
// Not(a Or b)
1755+
Value *CreateNor(Value *LHS, Value *RHS, const Twine &Name = "") {
1756+
return CreateNot(CreateOr(LHS, RHS), Name);
1757+
}
1758+
17491759
Value *CreateUnOp(Instruction::UnaryOps Opc,
17501760
Value *V, const Twine &Name = "",
17511761
MDNode *FPMathTag = nullptr) {

0 commit comments

Comments
 (0)