summaryrefslogtreecommitdiff
path: root/mlir/lib/CAPI/Dialect/LLVM.cpp
AgeCommit message (Collapse)Author
2025-01-31[mlir][llvmir][reland] expose Type(To/From)LLVMIRTranslator C API (#125110)Maksim Levental
2025-01-30Revert "[mlir][llvmir] expose Type(To/From)LLVMIRTranslator C API (#124864)"Maksim Levental
This reverts commit 7ae964c55b0a2b8dccf076ced9f1ffa8d5487eca. Revert "[mlir] Fix warnings" This reverts commit 0e43b9547d56762d29de9a99c998e7939417a1f3.
2025-01-30[mlir][llvmir] expose Type(To/From)LLVMIRTranslator C API (#124864)Maksim Levental
2025-01-07[MLIR][CAPI] export LLVMFunctionType param getter and setters (#121888)William Moses
2024-12-15MLIR-C: Add accessor for LLVM array type (#119998)William Moses
2024-10-07[mlir][debuginfo] Add support for subprogram annotations (#110946)Walter Erquinigo
LLVM already supports `DW_TAG_LLVM_annotation` entries for subprograms, but this hasn't been surfaced to the LLVM dialect. I'm doing the minimal amount of work to support string-based annotations, which is useful for attaching metadata to functions, which is useful for debuggers to offer features beyond basic DWARF. As LLVM already supports this, this patch is not controversial.
2024-09-02Reapply "[MLIR][LLVM] Make DISubprogramAttr cyclic" (#106571) with fixes ↵Tobias Gysi
(#106947) This reverts commit fa93be4, restoring commit d884b77, with fixes that ensure the CAPI declarations are exported properly. This commit implements LLVM_DIRecursiveTypeAttrInterface for the DISubprogramAttr to ensure cyclic subprograms can be imported properly. In the process multiple shortcuts around the recently introduced DIImportedEntityAttr can be removed.
2024-08-31Revert "[MLIR][LLVM] Make DISubprogramAttr cyclic" (#106827)Tobias Gysi
Reverts llvm/llvm-project#106571 This commit breaks the following build bot: https://lab.llvm.org/buildbot/#/builders/138/builds/2992 It looks like there is a missing dependency in this particular setup.
2024-08-31[MLIR][LLVM] Make DISubprogramAttr cyclic (#106571)Tobias Gysi
This commit implements LLVM_DIRecursiveTypeAttrInterface for the DISubprogramAttr to ensure cyclic subprograms can be imported properly. In the process multiple shortcuts around the recently introduced DIImportedEntityAttr can be removed.
2024-08-27[mlir][debug] Handle DIImportedEntity. (#103055)Abid Qadeer
The `DIImporedEntity` can be used to represent imported entities like C++'s namespace with using directive or fortran's moudule with use statement. This PR adds `DIImportedEntityAttr` and 2-way translation from `DIImportedEntity` to `DIImportedEntityAttr` and vice versa. When an entity is imported in a function, the `retainedNodes` field of the `DISubprogram` contains all the imported nodes. See the C++ code and the LLVM IR below. ``` void test() { using namespace n1; ... } !2 = !DINamespace(name: "n1", scope: null) !16 = distinct !DISubprogram(name: "test", ..., retainedNodes: !19) !19 = !{!20} !20 = !DIImportedEntity(tag: DW_TAG_imported_module, scope: !16, entity: !2 ...) ``` This PR makes sure that the translation from mlir to `retainedNodes` field happens correctly both ways. To side step the cyclic dependency between `DISubprogramAttr` and `DIImportedEntityAttr`, we have decided to not have `scope` field in the `DIImportedEntityAttr` and it is inferred from the entity which hold the list of `DIImportedEntityAttr`. A `retainedNodes` field has been added in the `DISubprogramAttr` which contains the list of `DIImportedEntityAttr` for that function. This PR currently does not handle entities imported in a global scope but that should be easy to handle in a subsequent PR.
2024-07-23[MLIR][DebugInfo] Enable the use of DILocalVariable DIFlags (#100190)Walter Erquinigo
This patch enables the use of flags for local variables in debug info. They were defaulted as always zero, but allowing them is pretty trivial.
2024-06-07[MLIR] Translate DIStringType. (#94480)Abid Qadeer
This PR handle translation of DIStringType. Mostly mechanical changes to translate DIStringType to/from DIStringTypeAttr. The 'stringLength' field is 'DIVariable' in DIStringType. As there was no `DIVariableAttr` previously, it has been added to ease the translation. --------- Co-authored-by: Tobias Gysi <tobias.gysi@nextsilicon.com>
2024-05-28[mlir] Add missing fields in DICompositeTypeAttr. (#93226)Abid Qadeer
The fortran arrays use 'dataLocation', 'rank', 'allocated' and 'associated' fields of the DICompositeType. These were not available in 'DICompositeTypeAttr'. This PR adds the missing fields. --------- Co-authored-by: Tobias Gysi <tobias.gysi@nextsilicon.com>
2024-05-16[MLIR][LLVM] add dwarfAddressSpace to DIDerivedType (#92043)William G Hatch
This field is present in LLVM, but was missing from the MLIR wrapper type. This addition allows MLIR languages to add proper DWARF info for GPU programs.
2024-04-24[mlir][python] extend LLVM bindings (#89797)Maksim Levental
Add bindings for LLVM pointer type.
2024-04-19Switch member calls to `isa/dyn_cast/cast/...` to free function calls. (#89356)Christian Sigg
This change cleans up call sites. Next step is to mark the member functions deprecated. See https://mlir.llvm.org/deprecation and https://discourse.llvm.org/t/preferred-casting-style-going-forward.
2024-04-09[MLIR][LLVM] Add DebugNameTableKind to DICompileUnit (#87974)Billy Zhu
Add the DebugNameTableKind field to DICompileUnit, along with its importer & exporter.
2024-03-20[MLIR][LLVM] Add extraData field to the DIDerivedType attribute (#85935)Christian Ulmann
This commit extends the DIDerivedTypeAttr with the `extraData` field. For now, the type of it is limited to be a `DINodeAttr`, as extending the debug metadata handling to support arbitrary metadata nodes does not seem to be necessary so far.
2024-03-15[MLIR][LLVM] Support Recursive DITypes (#80251)Billy Zhu
Following the discussion from [this thread](https://discourse.llvm.org/t/handling-cyclic-dependencies-in-debug-info/67526/11), this PR adds support for recursive DITypes. This PR adds: 1. DIRecursiveTypeAttrInterface: An interface that DITypeAttrs can implement to indicate that it supports recursion. See full description in code. 2. Importer & exporter support (The only DITypeAttr that implements the interface is DICompositeTypeAttr, so the exporter is only implemented for composites too. There will be two methods that each llvm DI type that supports mutation needs to implement since there's nothing general). --------- Co-authored-by: Tobias Gysi <tobias.gysi@nextsilicon.com>
2024-03-07[MLIR] Add llvm (debug) attributes to CAPI (#83992)Edgar
This PR adds the following to the mlir c api: - The disctinct mlir builtin attribute. - LLVM attributes (mostly debug related ones)
2024-02-14[mlir][python] expose LLVMStructType API (#81672)Oleksandr "Alex" Zinenko
Expose the API for constructing and inspecting StructTypes from the LLVM dialect. Separate constructor methods are used instead of overloads for better readability, similarly to IntegerType.
2023-10-30[MLIR][LLVM] Change CAPI pointer factory to create opaque pointers (#70572)Christian Ulmann
This commit changes the LLVM dialect's CAPI pointer getters to drop support for typed pointers. Typed pointers are deprecated and should no longer be generated.
2021-07-13Add more types to the LLVM dialect C APIAdam Paszke
This includes: - void type - array types - function types - literal (unnamed) struct types Reviewed By: jpienaar, ftynse Differential Revision: https://reviews.llvm.org/D105908
2021-07-02Add C API files for the LLVM dialectAdam Paszke
For now only expose a builder for the LLVM pointer type. Reviewed By: jpienaar, ftynse Differential Revision: https://reviews.llvm.org/D105346