summaryrefslogtreecommitdiff
path: root/mlir/lib/Dialect/Complex/IR/ComplexDialect.cpp
AgeCommit message (Collapse)Author
2025-07-21[mlir][NFC] update `mlir/Dialect` create APIs (16/n) (#149922)Maksim Levental
See https://github.com/llvm/llvm-project/pull/147168 for more info.
2025-07-13[mlir] Remove unused includes (NFC) (#148535)Kazu Hirata
2024-03-27[NFC][mlir] Reorder `declarePromisedInterface()` operands (#86628)Justin Fargnoli
Reorder the template operands of `declarePromisedInterface()` to match `declarePromisedInterfaces()`.
2024-01-10[mlir] allow inlining complex ops (#77514)Okwan Kwon
Complex ops are pure ops just like the arithmetic ops so they can be inlined.
2024-01-08[mlir] Declare promised interfaces for the ConvertToLLVM extension (#76341)Justin Fargnoli
This PR adds promised interface declarations for `ConvertToLLVMPatternInterface` in all the dialects that support the `ConvertToLLVM` dialect extension. Promised interfaces allow a dialect to declare that it will have an implementation of a particular interface, crashing the program if one isn't provided when the interface is used.
2023-05-12[mlir] Update method cast calls to function callsTres Popp
The MLIR classes Type/Attribute/Operation/Op/Value support cast/dyn_cast/isa/dyn_cast_or_null functionality through llvm's doCast functionality in addition to defining methods with the same name. This change begins the migration of uses of the method to the corresponding function call as has been decided as more consistent. Note that there still exist classes that only define methods directly, such as AffineExpr, and this does not include work currently to support a functional cast/isa call. Context: * https://mlir.llvm.org/deprecation/ at "Use the free function variants for dyn_cast/cast/isa/…" * Original discussion at https://discourse.llvm.org/t/preferred-casting-style-going-forward/68443 Implementation: This follows a previous patch that updated calls `op.cast<T>()-> cast<T>(op)`. However some cases could not handle an unprefixed `cast` call due to occurrences of variables named cast, or occurring inside of class definitions which would resolve to the method. All C++ files that did not work automatically with `cast<T>()` are updated here to `llvm::cast` and similar with the intention that they can be easily updated after the methods are removed through a find-replace. See https://github.com/llvm/llvm-project/compare/main...tpopp:llvm-project:tidy-cast-check for the clang-tidy check that is used and then update printed occurrences of the function to include `llvm::` before. One can then run the following: ``` ninja -C $BUILD_DIR clang-tidy run-clang-tidy -clang-tidy-binary=$BUILD_DIR/bin/clang-tidy -checks='-*,misc-cast-functions'\ -export-fixes /tmp/cast/casts.yaml mlir/*\ -header-filter=mlir/ -fix rm -rf $BUILD_DIR/tools/mlir/**/*.inc ``` Differential Revision: https://reviews.llvm.org/D150348
2023-04-20[mlir][arith] Add arith.constant materialization helperRahul Kayaith
This adds `arith::ConstantOp::materialize`, which builds a constant from an attribute and type only if it would result in a valid op. This is useful for dialect `materializeConstant` hooks, and allows for removing the previous `Attribute, Type` builder which was only used during materialization. Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D148491
2022-09-29[mlir][arith] Change dialect name from Arithmetic to ArithJakub Kuderski
Suggested by @lattner in https://discourse.llvm.org/t/rfc-define-precise-arith-semantics/65507/22. Tested with: `ninja check-mlir check-mlir-integration check-mlir-mlir-spirv-cpu-runner check-mlir-mlir-vulkan-runner check-mlir-examples` and `bazel build --config=generic_clang @llvm-project//mlir:all`. Reviewed By: lattner, Mogball, rriddle, jpienaar, mehdi_amini Differential Revision: https://reviews.llvm.org/D134762
2022-07-29[mlir][Complex] Add convenience builder for complex.number attribute.Adrian Kuegel
Differential Revision: https://reviews.llvm.org/D130756
2022-07-28[mlir][Complex] Change complex.number attribute type to ComplexType.Adrian Kuegel
It is more useful to use ComplexType as type of the attribute than to use the element type as attribute type. This means when using this attribute in complex::ConstantOp, we just need to check whether the types match. Reviewed By: pifon2a Differential Revision: https://reviews.llvm.org/D130703
2022-07-28[mlir] Small stylistic changes to Complex_NumberAttrAlexander Belyaev
Differential Revision: https://reviews.llvm.org/D130632
2022-07-27[mlir][complex] Custom attribute comlex.number.lewuathe
Add custom attribute for complex dialect. Although this commit does not have significant impact on the conversion framework, it will lead us to construct complex numbers in a readable and tidy manner. Related discussion: https://reviews.llvm.org/D127476 Reviewed By: pifon2a, akuegel Differential Revision: https://reviews.llvm.org/D130149
2022-01-26[mlir] Move the complex support of std.constant to a new complex.constant ↵River Riddle
operation This is part of splitting up the standard dialect. Differential Revision: https://reviews.llvm.org/D118182
2021-10-13[MLIR] Replace std ops with arith dialect opsMogball
Precursor: https://reviews.llvm.org/D110200 Removed redundant ops from the standard dialect that were moved to the `arith` or `math` dialects. Renamed all instances of operations in the codebase and in tests. Reviewed By: rriddle, jpienaar Differential Revision: https://reviews.llvm.org/D110797
2021-06-29[mlir] Generare .cpp.inc files for dialects.Stella Laurenzo
* Previously, we were only generating .h.inc files. We foresee the need to also generate implementations and this is a step towards that. * Discussed in https://llvm.discourse.group/t/generating-cpp-inc-files-for-dialects/3732/2 * Deviates from the discussion above by generating a default constructor in the .cpp.inc file (and adding a tablegen bit that disables this in case if this is user provided). * Generating the destructor started as a way to flush out the missing includes (produces a link error), but it is a strict improvement on its own that is worth doing (i.e. by emitting key methods in the .cpp file, we root vtables in one translation unit, which is a non-controversial improvement). Differential Revision: https://reviews.llvm.org/D105070
2021-01-15[mlir] Add Complex dialect.Alexander Belyaev
Differential Revision: https://reviews.llvm.org/D94764