[all-commits] [llvm/llvm-project] cf487c: [mlir][llvm] Make the import of LLVM IR intrinsics...

Tobias Gysi via All-commits all-commits at lists.llvm.org
Mon Jan 2 02:52:32 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cf487cce6f64fe2a397d43108bfdbad01a8754fb
      https://github.com/llvm/llvm-project/commit/cf487cce6f64fe2a397d43108bfdbad01a8754fb
  Author: Tobias Gysi <tobias.gysi at nextsilicon.com>
  Date:   2023-01-02 (Mon, 02 Jan 2023)

  Changed paths:
    M mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
    M mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
    M mlir/include/mlir/Target/LLVMIR/Dialect/All.h
    A mlir/include/mlir/Target/LLVMIR/Dialect/LLVMIR/LLVMIRToLLVMTranslation.h
    M mlir/include/mlir/Target/LLVMIR/Import.h
    A mlir/include/mlir/Target/LLVMIR/LLVMImportInterface.h
    M mlir/include/mlir/Target/LLVMIR/ModuleImport.h
    M mlir/include/mlir/Tools/mlir-translate/Translation.h
    M mlir/lib/Target/LLVMIR/CMakeLists.txt
    M mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp
    M mlir/lib/Target/LLVMIR/Dialect/LLVMIR/CMakeLists.txt
    A mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMIRToLLVMTranslation.cpp
    M mlir/lib/Target/LLVMIR/ModuleImport.cpp
    M mlir/lib/Tools/mlir-translate/Translation.cpp
    M mlir/tools/mlir-tblgen/LLVMIRConversionGen.cpp

  Log Message:
  -----------
  [mlir][llvm] Make the import of LLVM IR intrinsics extensible.

The revision introduces the LLVMImportDialectInterface to make the
import of LLVM IR intrinsics extensible. It uses a dialect interface
that enables external projects to provide their own conversion functions
for custom intrinsics. These conversion functions can rely on the
ModuleImport class to perform support tasks such as mapping LLVM
values to MLIR values or for converting types between the two worlds.

The implementation largely mirrors the export implementation. One major
difference is the dispatch to the appropriate dialect interface, since
LLVM IR intrinsics have no direct association to an MLIR dialect. The
dialect interfaces thus have to publish the supported intrinsics to
ensure incoming conversion calls are dispatched to the right dialect
interface.

The revision implements the extensible intrinsic import discussed as
part of the "extensible llvm ir import" rfc:
https://discourse.llvm.org/t/rfc-extensible-llvm-ir-import/67256/6

Reviewed By: ftynse

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




More information about the All-commits mailing list