This patch adds llvm.indirect_br.
LLVM Language reference suggests that repetition of labels, although allowed, is not useful. The same behaviour is implemented here. Also, the order of labels does not matter.
Syntax:
llvm.indirect_br <address> [ label1 label2 ... ] : <type>
Example:
LLVM IR
indirectbr i8* %address, [label %bb1, label %bb2, label %bb2]
MLIR LLVM Dialect
llvm.indirect_br %arg0 [^bb1, ^bb2] : !llvm<"i8*">
Why choose a slightly different name (indirect_br vs indirectbr)? It may be slightly more readable, but is likely to cause issues due to this discrepancy.