[all-commits] [llvm/llvm-project] 0cf066: [mlir][llvm] Make the import of LLVM IR metadata e...

Tobias Gysi via All-commits all-commits at lists.llvm.org
Tue Jan 3 05:50:25 PST 2023


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

  Changed paths:
    M mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td
    M mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
    M mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
    M mlir/include/mlir/Target/LLVMIR/LLVMImportInterface.h
    M mlir/include/mlir/Target/LLVMIR/ModuleImport.h
    M mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMIRToLLVMTranslation.cpp
    M mlir/lib/Target/LLVMIR/ModuleImport.cpp
    M mlir/test/Target/LLVMIR/Import/import-failure.ll
    A mlir/test/Target/LLVMIR/Import/profiling-metadata.ll
    M mlir/tools/mlir-tblgen/LLVMIRConversionGen.cpp

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

This revision extends the LLVMImportDialectInterface to make the import
of LLVM IR instruction-level metadata extensible. It extends the
signature of the existing dialect interface to provide a method to
import specific metadata kinds and attach them to the imported
operation. The conversion function can rely on the ModuleImport class
to perform support tasks.

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

The interface method names changed a bit compared to the suggested
design. The hook to set the instruction level metadata is now called
setMetadataAttrs and takes the metadata kind as an additional parameter.
We do not hand in the original LLVM IR instruction since it is not used
at this point. Importing named module-level meta data can be added in a
later stage after gaining some experience with this extension mechanism.

Depends on D140374

Reviewed By: ftynse, Dinistro

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




More information about the All-commits mailing list