@@ -3438,7 +3438,46 @@ void InlineAsmOp::getEffects(
34383438void LLVM::AssumeOp::build (OpBuilder &builder, OperationState &state,
34393439 mlir::Value cond) {
34403440 return build (builder, state, cond, /* op_bundle_operands=*/ {},
3441- /* op_bundle_tags=*/ {});
3441+ /* op_bundle_tags=*/ ArrayAttr{});
3442+ }
3443+
3444+ void LLVM::AssumeOp::build (
3445+ OpBuilder &builder, OperationState &state, mlir::Value cond,
3446+ ArrayRef<llvm::OperandBundleDefT<mlir::Value>> opBundles) {
3447+ SmallVector<mlir::ValueRange> opBundleOperands;
3448+ SmallVector<mlir::Attribute> opBundleTags;
3449+ opBundleOperands.reserve (opBundles.size ());
3450+ opBundleTags.reserve (opBundles.size ());
3451+
3452+ for (const llvm::OperandBundleDefT<mlir::Value> &bundle : opBundles) {
3453+ opBundleOperands.emplace_back (bundle.inputs ());
3454+ opBundleTags.push_back (
3455+ StringAttr::get (builder.getContext (), bundle.getTag ()));
3456+ }
3457+
3458+ auto opBundleTagsAttr = ArrayAttr::get (builder.getContext (), opBundleTags);
3459+ return build (builder, state, cond, opBundleOperands, opBundleTagsAttr);
3460+ }
3461+
3462+ void LLVM::AssumeOp::build (OpBuilder &builder, OperationState &state,
3463+ mlir::Value cond, llvm::StringRef tag,
3464+ mlir::ValueRange args) {
3465+ llvm::OperandBundleDefT<mlir::Value> opBundle (
3466+ tag.str (), std::vector<mlir::Value>(args.begin (), args.end ()));
3467+ return build (builder, state, cond, opBundle);
3468+ }
3469+
3470+ void LLVM::AssumeOp::build (OpBuilder &builder, OperationState &state,
3471+ mlir::Value cond, AssumeAlignTag, mlir::Value ptr,
3472+ mlir::Value align) {
3473+ return build (builder, state, cond, " align" , ValueRange{ptr, align});
3474+ }
3475+
3476+ void LLVM::AssumeOp::build (OpBuilder &builder, OperationState &state,
3477+ mlir::Value cond, AssumeSeparateStorageTag,
3478+ mlir::Value ptr1, mlir::Value ptr2) {
3479+ return build (builder, state, cond, " separate_storage" ,
3480+ ValueRange{ptr1, ptr2});
34423481}
34433482
34443483LogicalResult LLVM::AssumeOp::verify () { return verifyOperandBundles (*this ); }
0 commit comments