[PATCH] D74916: [MLIR] Added llvm.indirect_br

shraiysh via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 20 11:06:09 PST 2020


shraiysh created this revision.
shraiysh added reviewers: rriddle, ftynse.
Herald added subscribers: llvm-commits, Joonsoo, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, nicolasvasilache, antiagainst, shauheen, burmako, jpienaar, mehdi_amini.
Herald added 1 blocking reviewer(s): rriddle.
Herald added a project: LLVM.

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> : <type> [ label1 label2 ... ]`

Example:
LLVM IR
`indirectbr i8* %address, [label %bb1, label %bb2, label %bb2]`
MLIR LLVM Dialect
`llvm.indirect_br %arg0 : !llvm<"i8*"> [^bb1, ^bb2]`


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D74916

Files:
  mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
  mlir/include/mlir/IR/OpImplementation.h
  mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
  mlir/lib/IR/AsmPrinter.cpp
  mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp
  mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
  mlir/test/Dialect/LLVMIR/roundtrip.mlir
  mlir/test/Target/import.ll
  mlir/test/Target/llvmir.mlir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74916.245693.patch
Type: text/x-patch
Size: 10116 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200220/85c5ebab/attachment.bin>


More information about the llvm-commits mailing list