================
@@ -306,6 +306,24 @@ class CIRBaseBuilderTy : public mlir::OpBuilder {
return createBinop(loc, lhs, cir::BinOpKind::Or, rhs);
}
+ mlir::Value createSelect(mlir::Location loc, mlir::Value condition,
+ mlir::Value trueValue, mlir::Value falseValue) {
+ assert(trueValue.getType() == falseValue.getType() &&
+ "trueValue and falseValue should have the same type");
+ return create<cir::SelectOp>(loc, trueValue.getType(), condition,
trueValue,
+ falseValue);
+ }
+
+ mlir::Value createLogicalAnd(mlir::Location loc, mlir::Value lhs,
----------------
andykaylor wrote:
It appears these will only work if lhs and rhs are bool values. I guess the
assert above will force that, but it initially surprised me.
https://github.com/llvm/llvm-project/pull/138156
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits