[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
Loading
Please sign in to comment