[PATCH] D75619: [mlir] LLVM dialect: move ensureDistinctSuccessors out of std->LLVM conversion

Alex Zinenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 4 09:00:31 PST 2020


ftynse created this revision.
ftynse added a reviewer: mehdi_amini.
Herald added subscribers: llvm-commits, Joonsoo, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, nicolasvasilache, antiagainst, shauheen, burmako, jpienaar, rriddle, mgorny.
Herald added a project: LLVM.
ftynse added a reviewer: stephenneuendorffer.
ftynse updated this revision to Diff 248200.
ftynse added a comment.

rebase


MLIR supports terminators that have the same successor block with different
block operands, which cannot be expressed in the LLVM's phi-notation as the
block identifier is used to tell apart the predecessors. This limitation can be
worked around by branching to a new block instead, with this new block
unconditionally branching to the original successor and forwarding the
argument. Until now, this transformation was performed during the conversion
from the Standard to the LLVM dialect. This does not scale well to multiple
dialects targeting the LLVM dialect as all of them would have to be aware of
this limitation and perform the preparatory transformation. Instead, do it as a
separate pass and run it immediately before the translation.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D75619

Files:
  mlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h
  mlir/include/mlir/Dialect/LLVMIR/Transforms/Legalize.h
  mlir/include/mlir/InitAllPasses.h
  mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h
  mlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp
  mlir/lib/Dialect/LLVMIR/CMakeLists.txt
  mlir/lib/Dialect/LLVMIR/Transforms/CMakeLists.txt
  mlir/lib/Dialect/LLVMIR/Transforms/Legalize.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75619.248200.patch
Type: text/x-patch
Size: 10739 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200304/50fad54b/attachment-0001.bin>


More information about the llvm-commits mailing list