[Mlir-commits] [mlir] [MLIR][LLVM] Support for indirectbr (PR #135092)

Bruno Cardoso Lopes llvmlistbot at llvm.org
Thu Apr 10 16:04:46 PDT 2025


================
@@ -1705,6 +1705,65 @@ def LLVM_BlockTagOp : LLVM_Op<"blocktag"> {
   let hasVerifier = 0;
 }
 
+//===----------------------------------------------------------------------===//
+// IndirectBrOp
+//===----------------------------------------------------------------------===//
+
+def LLVM_IndirectBrOp : LLVM_TerminatorOp<"indirectbr",
+    [SameVariadicOperandSize, DeclareOpInterfaceMethods<BranchOpInterface>,
+     Pure]> {
+  let description = [{
+    Transfer control flow to address in `$addr`. A list of possible target
+    blocks in `$successors` can be provided and maybe used as a hint in LLVM:
----------------
bcardosolopes wrote:

I tried inserting the owner block as a successor, but I get: `error: operation with block successors must terminate its parent block`, so this won't work. Any other ideas? 

https://github.com/llvm/llvm-project/pull/135092


More information about the Mlir-commits mailing list