[Mlir-commits] [mlir] cf14ef9 - [mlir][llvm] Add a convenience builder to BrOp
Jeff Niu
llvmlistbot at llvm.org
Wed Jan 11 12:04:23 PST 2023
Author: Jeff Niu
Date: 2023-01-11T12:04:16-08:00
New Revision: cf14ef983a49e47ac49e1a9f64cf0849c8b664bc
URL: https://github.com/llvm/llvm-project/commit/cf14ef983a49e47ac49e1a9f64cf0849c8b664bc
DIFF: https://github.com/llvm/llvm-project/commit/cf14ef983a49e47ac49e1a9f64cf0849c8b664bc.diff
LOG: [mlir][llvm] Add a convenience builder to BrOp
This builder takes no successor arguments.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D141522
Added:
Modified:
mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
Removed:
################################################################################
diff --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
index bfb222625e25f..f426d691a3d5f 100644
--- a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
+++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
@@ -772,7 +772,12 @@ def LLVM_BrOp : LLVM_TerminatorOp<"br",
let assemblyFormat = [{
$dest (`(` $destOperands^ `:` type($destOperands) `)`)? attr-dict
}];
- let builders = [LLVM_TerminatorPassthroughOpBuilder];
+ let builders = [
+ OpBuilder<(ins "Block *":$dest), [{
+ build($_builder, $_state, ValueRange(), dest);
+ }]>,
+ LLVM_TerminatorPassthroughOpBuilder
+ ];
}
def LLVM_CondBrOp : LLVM_TerminatorOp<"cond_br",
[AttrSizedOperandSegments, DeclareOpInterfaceMethods<BranchOpInterface>,
More information about the Mlir-commits
mailing list