aboutsummaryrefslogtreecommitdiff
path: root/mlir/lib/CAPI/Dialect
AgeCommit message (Collapse)AuthorFilesLines
2026-02-12[MLIR][Python] Impl XOpInterface(s) from Python, with X=Transform and ↵Rolf Morel1-0/+212
X=MemoryEffects (#176920) Provides the infrastructure for implementing and late-binding OpInterfaces from Python. * On the mlir-c API declaration side, each `XOpInterface` has a callback struct, with a callback for each method and a userdata member (provided as an arg to each method), and a `mlirXOpInterfaceAttachFallbackModel(ctx, op_name, callbacks)` func. * This CAPI is implemented by defining a subclass of `XOpInterface::FallbackModel` that holds the callback struct and has each method call the corresponding callback (with userdata as an arg). Given a callback struct, a new `FallbackModel` is created and attached, i.e. late bound, to the named op. (MLIR's interface infrastructure is such that the thus registered `FallbackModel` will be returned in case the op gets cast to the `XOpInterface`.) * On the Python side, we expose a stand-in `XOpInterface` base class which has one (class)method: `XOpInterface.attach(cls, op_name, ctx)`. Python users subclass this class (`class MyInterfaceImpl(XOpInterface): ...`) and implement the interface's methods (with the right names and signatures). The user calls `attach` on the subclass (`MyInterfaceImpl.attach("my_dialect.my_op", ctx)`) which prepares the callbacks struct _with userdata set to the subclass_ (as we use it to lookup methods). These callbacks (and userdata) are then registered as an `XOpInterface::FallbackModel` by `mlirXOpInterfaceAttachFallbackModel(...)`. From then on the Python methods will be used to respond to calls to the interface methods (originating in C++). This PR enables implementing the TransformOpInterface and the MemoryEffectsOpInterface, both of which are required for making an op into a transform op. Everything besides the above linked code is there to facilitate exposing the interfaces: the right types for the arguments of the methods are exposed as are functions/methods for manipulating these arguments (e.g. specifying side effects on `OpOperand`s and `OpResult`s and being able to access and set the transform handles associated with args and results).
2026-01-27[MLIR][LLVM] Add flags field to the DIDerivedType attribute (#177889)Keyi Zhang1-5/+7
This PR extends the `DIDerivedType` with the `flags` field. Fixes https://github.com/llvm/llvm-project/issues/177725
2026-01-07[mlir][CAPI] fix linker again after #82190 (#174876)Maksim Levental1-0/+1
2026-01-07[mlir][CAPI][transform] fix linker after #82190 (#174866)Maksim Levental1-0/+2
2026-01-07[MLIR] Add missing dialects to C API (#82190)Sergio Sánchez Ramírez43-40/+1128
We are trying to make a wrapper of MLIR for Julia in https://github.com/JuliaLabs/MLIR.jl, but some dialects are missing in `libMLIR-C`. This PR adds them.
2026-01-07[MLIR][Python] Forward the name of MLIR attrs to Python side (#174756)Twice5-0/+102
This PR is quite similiar to #174700. In this PR, I added a C API for each (upstream) MLIR attributes to retrieve its name (for example, `StringAttr -> mlirStringAttrGetName() -> "builtin.string"`), and exposed a corresponding type_name class attribute in the Python bindings (e.g., `StringAttr.attr_name -> "builtin.string"`). This can be used in various places to avoid hard-coded strings, such as eliminating the manual string in `irdl.base("#builtin.string")`. Note that parts of this PR (mainly mechanical changes) were produced via GitHub Copilot and GPT-5.2. I have manually reviewed the changes and verified them with tests to ensure correctness.
2026-01-07[MLIR][Python] Forward the name of MLIR types to Python side (#174700)Twice9-0/+132
In this PR, I added a C API for each (upstream) MLIR type to retrieve its type name (for example, `IntegerType` -> `mlirIntegerTypeGetName()` -> `"builtin.integer"`), and exposed a corresponding `type_name` class attribute in the Python bindings (e.g., `IntegerType.type_name` -> `"builtin.integer"`). This can be used in various places to avoid hard-coded strings, such as eliminating the manual string in `irdl.base("!builtin.integer")`. Note that parts of this PR (mainly mechanical changes) were produced via GitHub Copilot and GPT-5.2. I have manually reviewed the changes and verified them with tests to ensure correctness.
2026-01-05[mlir][Python] use canonical Python `isinstance` instead of ↵Maksim Levental2-0/+40
`Type.isinstance` (#172892) We've been able to do `isinstance(x, Type)` for a quite a while now (since https://github.com/llvm/llvm-project/commit/bfb1ba752655bf09b35c486f6cc9817dbedfb1bb) so remove `Type.isinstance` and the the special-casing (`_is_integer_type`, `_is_floating_point_type`, `_is_index_type`) in some places (and therefore support various `fp8`, `fp6`, `fp4` types).
2025-12-24[MLIR] quick fix errors introduced in #173228 (#173474)Sergio Sánchez Ramírez1-3/+6
My bad, I thought that the build was being run for PRs, everything succeeded and didn't test out on local. Now main branch is throwing these errors on CI: ``` [490/2482] Building CXX object tools/mlir/lib/CAPI/Dialect/CMakeFiles/obj.MLIRCAPIComplex.dir/Complex.cpp.o FAILED: tools/mlir/lib/CAPI/Dialect/CMakeFiles/obj.MLIRCAPIComplex.dir/Complex.cpp.o /usr/local/bin/c++ -DGTEST_HAS_RTTI=0 -DMLIR_CAPI_BUILDING_LIBRARY=1 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GLIBCXX_USE_CXX11_ABI=1 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla/stage1/tools/mlir/lib/CAPI/Dialect -I/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla/llvm/mlir/lib/CAPI/Dialect -I/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla/stage1/tools/mlir/include -I/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla/llvm/mlir/include -I/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla/stage1/include -I/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla/llvm/llvm/include -mcpu=neoverse-v2 -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wundef -Werror=mismatched-tags -O3 -DNDEBUG -std=c++17 -fvisibility=hidden -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/mlir/lib/CAPI/Dialect/CMakeFiles/obj.MLIRCAPIComplex.dir/Complex.cpp.o -MF tools/mlir/lib/CAPI/Dialect/CMakeFiles/obj.MLIRCAPIComplex.dir/Complex.cpp.o.d -o tools/mlir/lib/CAPI/Dialect/CMakeFiles/obj.MLIRCAPIComplex.dir/Complex.cpp.o -c /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla/llvm/mlir/lib/CAPI/Dialect/Complex.cpp ../llvm/mlir/lib/CAPI/Dialect/Complex.cpp:15:45: error: no member named 'complex' in namespace 'mlir' 15 | mlir::complex::ComplexDialect) | ~~~~~~^ ../llvm/mlir/include/mlir/CAPI/Registration.h:39:30: note: expanded from macro 'MLIR_DEFINE_CAPI_DIALECT_REGISTRATION' 39 | unwrap(registry)->insert<ClassName>(); \ | ^~~~~~~~~ ../llvm/mlir/lib/CAPI/Dialect/Complex.cpp:15:45: error: no member named 'complex' in namespace 'mlir' 15 | mlir::complex::ComplexDialect) | ~~~~~~^ ../llvm/mlir/include/mlir/CAPI/Registration.h:42:51: note: expanded from macro 'MLIR_DEFINE_CAPI_DIALECT_REGISTRATION' 42 | return wrap(unwrap(context)->getOrLoadDialect<ClassName>()); \ | ^~~~~~~~~ ../llvm/mlir/lib/CAPI/Dialect/Complex.cpp:15:45: error: no member named 'complex' in namespace 'mlir' 15 | mlir::complex::ComplexDialect) | ~~~~~~^ ../llvm/mlir/include/mlir/CAPI/Registration.h:45:17: note: expanded from macro 'MLIR_DEFINE_CAPI_DIALECT_REGISTRATION' 45 | return wrap(ClassName::getDialectNamespace()); \ | ^~~~~~~~~ ../llvm/mlir/lib/CAPI/Dialect/Complex.cpp:18:14: error: use of undeclared identifier 'ComplexAttr' 18 | return isa<ComplexAttr>(unwrap(attr)); | ^~~~~~~~~~~ ../llvm/mlir/lib/CAPI/Dialect/Complex.cpp:24:7: error: use of undeclared identifier 'complex' 24 | complex::NumberAttr::get(cast<ComplexType>(unwrap(type)), real, imag)); | ^ ../llvm/mlir/lib/CAPI/Dialect/Complex.cpp:24:37: error: unknown type name 'ComplexType'; did you mean 'mlir::ComplexType'? 24 | complex::NumberAttr::get(cast<ComplexType>(unwrap(type)), real, imag)); | ^~~~~~~~~~~ | mlir::ComplexType tools/mlir/include/mlir/IR/BuiltinTypes.h.inc:733:7: note: 'mlir::ComplexType' declared here 733 | class ComplexType : public ::mlir::Type::TypeBase<ComplexType, ::mlir::Type, detail::ComplexTypeStorage> { | ^ ../llvm/mlir/lib/CAPI/Dialect/Complex.cpp:24:32: warning: use of function template name with no prior declaration in function call with explicit template arguments is a C++20 extension [-Wc++20-extensions] 24 | complex::NumberAttr::get(cast<ComplexType>(unwrap(type)), real, imag)); | ^ ../llvm/mlir/lib/CAPI/Dialect/Complex.cpp:29:15: error: use of undeclared identifier 'complex' 29 | return wrap(complex::NumberAttr::getChecked( | ^ ../llvm/mlir/lib/CAPI/Dialect/Complex.cpp:30:25: error: unknown type name 'ComplexType'; did you mean 'mlir::ComplexType'? 30 | unwrap(loc), cast<ComplexType>(unwrap(type)), real, imag)); | ^~~~~~~~~~~ | mlir::ComplexType tools/mlir/include/mlir/IR/BuiltinTypes.h.inc:733:7: note: 'mlir::ComplexType' declared here 733 | class ComplexType : public ::mlir::Type::TypeBase<ComplexType, ::mlir::Type, detail::ComplexTypeStorage> { | ^ ../llvm/mlir/lib/CAPI/Dialect/Complex.cpp:30:20: warning: use of function template name with no prior declaration in function call with explicit template arguments is a C++20 extension [-Wc++20-extensions] 30 | unwrap(loc), cast<ComplexType>(unwrap(type)), real, imag)); | ^ ../llvm/mlir/lib/CAPI/Dialect/Complex.cpp:34:15: error: use of undeclared identifier 'complex' 34 | return cast<complex::NumberAttr>(unwrap(attr)).getRealAsDouble(); | ^ ../llvm/mlir/lib/CAPI/Dialect/Complex.cpp:38:15: error: use of undeclared identifier 'complex' 38 | return cast<complex::NumberAttr>(unwrap(attr)).getImagAsDouble(); | ^ ../llvm/mlir/lib/CAPI/Dialect/Complex.cpp:42:15: error: use of undeclared identifier 'complex' 42 | return wrap(complex::NumberAttr::getTypeID()); | ^ ``` This PR fixes these errors. Tested on local that `MLIRCAPIComplex` target (the one erroring) now compiles correctly on local.
2025-12-24[MLIR] add C-API bindings for complex dialect (#173228)Sergio Sánchez Ramírez2-0/+52
The `complex` dialect is missing from the MLIR's C-API. This PR adds the functions for registration of the dialect and handling of `complex::NumberAttr`. --------- Co-authored-by: Oleksandr "Alex" Zinenko <azinenko@amd.com>
2025-12-16[mlir][amdgpu] Add Python bindings for TDM types (#172309)Tim Gymnich1-0/+53
Add bindings for: - `TDMBaseType` - `TDMDescriptorType` - `TDMGatherBaseType`
2025-12-09[MLIR][IRDL] Add C API for IRDL Variadicity attributes. (#171076)Mike Urbach1-0/+27
This add the basic APIs to create VariadicityAttr and VariadicityArrayAttr attributes from the C API. This is necessary for C API users that want to create IRDL dialect declarations.
2025-11-24[MLIR][Python] add GetTypeID for llvm.struct_type and llvm.ptr and enable ↵Maksim Levental1-0/+8
downcasting (#169383)
2025-11-15[mlir] Adopt cast function objects. NFC. (#168228)Jakub Kuderski1-8/+7
These were added in https://github.com/llvm/llvm-project/pull/165803.
2025-11-12[mlir][linalg][python] Add Python Bindings for Inferring Contraction ↵Bangtian Liu1-3/+35
Dimensions from Affine Maps (#167587) This PR exposes `linalg::inferContractionDims(ArrayRef<AffineMap>)` to Python, allowing users to infer contraction dimensions (batch/m/n/k) directly from a list of affine maps without needing an operation. --------- Signed-off-by: Bangtian Liu <liubangtian@gmail.com>
2025-09-26[mlir] Add splitDebugFilename field in DIComplileUnitAttr. (#160704)Abid Qadeer1-8/+7
Mostly mechanical changes to add the missing field.
2025-09-14[MLIR] Apply clang-tidy fixes for ↵Mehdi Amini1-2/+2
performance-unnecessary-copy-initialization in Linalg.cpp (NFC)
2025-09-03[MLIR][LLVM][Flang] Move the element param of DICompositeType to the end ↵Christian Ulmann1-3/+3
(#156624) This commit moves the "element" param of `DICompositeType` to the end of the parameter list. This is required as there seems to be a bug in the attribute parser that breaks a print + parse roundtrip. Related ticket: https://github.com/llvm/llvm-project/issues/156623
2025-06-26[MLIR][Linalg] Harden parsing Linalg named ops (#145337)Mehdi Amini1-1/+1
This thread through proper error handling / reporting capabilities to avoid hitting llvm_unreachable while parsing linalg ops. Fixes #132755 Fixes #132740 Fixes #129185
2025-04-17[MLIR][CAPI][python] expose the python binding for linalgOp.getIndexingMaps ↵Bangtian Liu1-0/+10
(#136054) This PR is mainly about exposing the python bindings for `linalgOp.getIndexingMaps`. --------- Signed-off-by: Bangtian Liu <liubangtian@gmail.com>
2025-04-16[mlir][SMT] add python bindings (#135674)Maksim Levental1-24/+28
This PR adds "rich" python bindings to SMT dialect.
2025-04-14[mlir][SMT] C APIs (#135501)Maksim Levental2-0/+132
This PR upstreams/adds the C APIs for SMT dialect (from CIRCT). --------- Co-authored-by: Bea Healy <beahealy22@gmail.com> Co-authored-by: Martin Erhart <maerhart@outlook.com> Co-authored-by: Mike Urbach <mikeurbach@gmail.com> Co-authored-by: Will Dietz <will.dietz@sifive.com> Co-authored-by: fzi-hielscher <hielscher@fzi.de> Co-authored-by: Fehr Mathieu <mathieu.fehr@gmail.com> Co-authored-by: Clo91eaf <Clo91eaf@qq.com>
2025-04-10[mlir][CAPI][python] expose the python bindings for ↵Bangtian Liu1-1/+46
linalg::isaConvolutionOpInterface and linalg::inferConvolutionDims (#135253) This PR is mainly about exposing the python bindings for `linalg::isaConvolutionOpInterface` and `linalg::inferConvolutionDims`. --------- Signed-off-by: Bangtian Liu <liubangtian@gmail.com>
2025-04-09[mlir][CAPI][python] expose the python bindings for ↵Bangtian Liu1-0/+34
linalg::isaContractionOpInterface and linalg::inferContractionDims (#134935) This PR is mainly about exposing the python bindings for` linalg::isaContractionOpInterface` and` linalg::inferContractionDims`. --------- Signed-off-by: Bangtian Liu <liubangtian@gmail.com>
2025-03-23Sub-channel quantized type implementation (#120172)Sandeep Dasgupta1-0/+56
This is an implementation for [RFC: Supporting Sub-Channel Quantization in MLIR](https://discourse.llvm.org/t/rfc-supporting-sub-channel-quantization-in-mlir/82694). In order to make the review process easier, the PR has been divided into the following commit labels: 1. **Add implementation for sub-channel type:** Includes the class design for `UniformQuantizedSubChannelType`, printer/parser and bytecode read/write support. The existing types (per-tensor and per-axis) are unaltered. 2. **Add implementation for sub-channel type:** Lowering of `quant.qcast` and `quant.dcast` operations to Linalg operations. 3. **Adding C/Python Apis:** We first define he C-APIs and build the Python-APIs on top of those. 4. **Add pass to normalize generic ....:** This pass normalizes sub-channel quantized types to per-tensor per-axis types, if possible. A design note: - **Explicitly storing the `quantized_dimensions`, even when they can be derived for ranked tensor.** While it's possible to infer quantized dimensions from the static shape of the scales (or zero-points) tensor for ranked data tensors ([ref](https://discourse.llvm.org/t/rfc-supporting-sub-channel-quantization-in-mlir/82694/3) for background), there are cases where this can lead to ambiguity and issues with round-tripping. ``` Consider the example: tensor<2x4x!quant.uniform<i8:f32:{0:2, 0:2}, {{s00:z00, s01:z01}}>> ``` The shape of the scales tensor is [1, 2], which might suggest that only axis 1 is quantized. While this inference is technically correct, as the block size for axis 0 is a degenerate case (equal to the dimension size), it can cause problems with round-tripping. Therefore, even for ranked tensors, we are explicitly storing the quantized dimensions. Suggestions welcome! PS: I understand that the upcoming holidays may impact your schedule, so please take your time with the review. There's no rush.
2025-02-13[mlir][index] Add CAPI (#127039)Martin Erhart2-0/+22
2025-02-06[mlir] feat: add `mlirFuncSetResultAttr` (#125972)Avik Pal1-0/+6
cc @ftynse @wsmoses
2025-01-31[mlir][llvmir][reland] expose Type(To/From)LLVMIRTranslator C API (#125110)Maksim Levental1-0/+4
2025-01-30Revert "[mlir][llvmir] expose Type(To/From)LLVMIRTranslator C API (#124864)"Maksim Levental1-4/+0
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 Levental1-0/+4
2025-01-14[mlir][emitc] Expose emitc dialect types (#119645)Eliud de León1-0/+176
Added C API functions for the EmitC dialect types.
2025-01-07[MLIR][CAPI] export LLVMFunctionType param getter and setters (#121888)William Moses1-0/+10
2024-12-15MLIR-C: Add accessor for LLVM array type (#119998)William Moses1-0/+4
2024-12-11[mlir][emitc] Add support for C-API/python binding to EmitC dialect (#119476)Eliud de León2-0/+22
Added EmitC dialect bindings.
2024-10-07[mlir][debuginfo] Add support for subprogram annotations (#110946)Walter Erquinigo1-1/+15
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-10-02[MLIR][sparse] Add `soa` property to `sparse_tensor` Python bindings (#109135)Mateusz Sokół1-1/+3
2024-09-26[mlir] Improvements to the 'quant' dialect (#100667)Rafael Ubal1-3/+3
Full revamp of the 'quant' dialect. This is an implementation for the RFC at https://discourse.llvm.org/t/rfc-improvements-in-the-quant-dialect/79942
2024-09-02Reapply "[MLIR][LLVM] Make DISubprogramAttr cyclic" (#106571) with fixes ↵Tobias Gysi1-14/+25
(#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 Gysi1-25/+14
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 Gysi1-14/+25
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][gpu] Add metadata attributes for storing kernel metadata in GPU ↵Fabian Mora1-3/+34
objects (#95292) This patch adds the `#gpu.kernel_metadata` and `#gpu.kernel_table` attributes. The `#gpu.kernel_metadata` attribute allows storing metadata related to a compiled kernel, for example, the number of scalar registers used by the kernel. The attribute only has 2 required parameters, the name and function type. It also has 2 optional parameters, the arguments attributes and generic dictionary for storing all other metadata. The `#gpu.kernel_table` stores a table of `#gpu.kernel_metadata`, mapping the name of the kernel to the metadata. Finally, the function `ROCDL::getAMDHSAKernelsELFMetadata` was added to collect ELF metadata from a binary, and to test the class methods in both attributes. Example: ```mlir gpu.binary @binary [#gpu.object<#rocdl.target<chip = "gfx900">, kernels = #gpu.kernel_table<[ #gpu.kernel_metadata<"kernel0", (i32) -> (), metadata = {sgpr_count = 255}>, #gpu.kernel_metadata<"kernel1", (i32, f32) -> (), arg_attrs = [{llvm.read_only}, {}]> ]> , bin = "BLOB">] ``` The motivation behind these attributes is to provide useful information for things like tunning. --------- Co-authored-by: Mehdi Amini <joker.eph@gmail.com>
2024-08-27[mlir][debug] Handle DIImportedEntity. (#103055)Abid Qadeer1-2/+21
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-30[mlir] Apply ClangTidy performance finding.Adrian Kuegel1-0/+1
2024-07-23[MLIR][DebugInfo] Enable the use of DILocalVariable DIFlags (#100190)Walter Erquinigo1-6/+5
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-24[mlir][gpu] Add py binding for AsyncTokenType (#96466)Guray Ozen1-0/+12
The PR adds py binding for `AsyncTokenType`
2024-06-07[MLIR] Translate DIStringType. (#94480)Abid Qadeer1-0/+12
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 Qadeer1-2/+8
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 Hatch1-6/+8
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-05-11[MLIR] Add IRDL dialect loading to C API (#91852)Théo Degioanni2-0/+27
Being able to add custom dialects is one of the big missing pieces of the C API. This change should make it achievable via IRDL. Hopefully this should open custom dialect definition to non-C++ users of MLIR.
2024-04-24[mlir][sparse] Enable explicit and implicit value in sparse encoding (#88975)Yinying Li1-8/+18
1. Explicit value means the non-zero value in a sparse tensor. If explicitVal is set, then all the non-zero values in the tensor have the same explicit value. The default value Attribute() indicates that it is not set. 2. Implicit value means the "zero" value in a sparse tensor. If implicitVal is set, then the "zero" value in the tensor is equal to the implicit value. For now, we only support `0` as the implicit value but it could be extended in the future. The default value Attribute() indicates that the implicit value is `0` (same type as the tensor element type). Example: ``` #CSR = #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : dense, d1 : compressed), posWidth = 64, crdWidth = 64, explicitVal = 1 : i64, implicitVal = 0 : i64 }> ``` Note: this PR tests that implicitVal could be set to other values as well. The following PR will add verifier and reject any value that's not zero for implicitVal.