[Mlir-commits] [mlir] [MLIR][LLVM] Support for indirectbr (PR #135092)
Tobias Gysi
llvmlistbot at llvm.org
Wed Apr 9 23:46:11 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:
----------------
gysit wrote:
I wonder if we will run into issues with the optional successors. In particular, I wonder if there are passes that assume that the terminator specifies all possible successors? Can you maybe have a test case with a dead block and an indirect branch without successor hint in another block. Is region simplify killing the dead block? If yes we may want to think about ways to prevent it from deleting "presumbably" dead blocks that have a block tag. Maybe the tag op can have the block it is in as a successor or something (not sure if this works).
https://github.com/llvm/llvm-project/pull/135092
More information about the Mlir-commits
mailing list