[all-commits] [llvm/llvm-project] e11998: [mlir] LLVM dialect: move ensureDistinctSuccessors...

ftynse via All-commits all-commits at lists.llvm.org
Tue Mar 17 07:22:19 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: e119980f3f84cf83a81bb6dec9ebadb2b770a500
      https://github.com/llvm/llvm-project/commit/e119980f3f84cf83a81bb6dec9ebadb2b770a500
  Author: Alex Zinenko <zinenko at google.com>
  Date:   2020-03-17 (Tue, 17 Mar 2020)

  Changed paths:
    M mlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h
    A mlir/include/mlir/Dialect/LLVMIR/Transforms/LegalizeForExport.h
    M mlir/include/mlir/InitAllPasses.h
    M mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h
    M mlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp
    M mlir/lib/Dialect/LLVMIR/CMakeLists.txt
    A mlir/lib/Dialect/LLVMIR/Transforms/CMakeLists.txt
    A mlir/lib/Dialect/LLVMIR/Transforms/LegalizeForExport.cpp
    M mlir/lib/Target/CMakeLists.txt
    M mlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir
    A mlir/test/Dialect/LLVMIR/legalize-for-export.mlir

  Log Message:
  -----------
  [mlir] LLVM dialect: move ensureDistinctSuccessors out of std->LLVM conversion

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.

Differential Revision: https://reviews.llvm.org/D75619




More information about the All-commits mailing list