66 Commits

Author SHA1 Message Date
Lauri Vasama 15c5da73f2 Fix VoidType serialization 2026-06-15 17:28:22 +02:00
Lauri Vasama aa48a01400 Fix overwriting of names in Clift type import 2026-06-15 17:28:22 +02:00
Ivan Krysak 6d86e8ca71 CliftAttributes: improve mutation error message 2026-06-15 17:28:22 +02:00
Ivan Krysak 686dc0877a hasModuleAttr -> isCliftModule 2026-06-15 17:28:22 +02:00
Ivan Krysak 2da35c1252 Clift: pull all the module creation in one place 2026-06-15 17:28:22 +02:00
Ivan Krysak bb71b0e5a6 Clift: pull all the context creation in one place 2026-06-15 17:28:22 +02:00
Lauri Vasama afaff540ed Implement Clift local variable self-assignment
Local variable initializer regions can now have a block argument
representing the local variable being initialized.
2026-05-25 09:00:41 +02:00
Lauri Vasama 3064653e37 Add StatementOpInterface::getBlockArgumentVariable
Translates a mlir::BlockArgument to an mlir::Value more directly
representing the entity or expression to which the block argument
refers, or null if not applicable for the statement in question.
2026-05-25 09:00:41 +02:00
Lauri Vasama 7fe96c2c9a Improve clift::isLvalueExpression 2026-05-25 09:00:41 +02:00
Lauri Vasama 5d3e3f73d9 Add clift.require operation 2026-05-13 15:32:34 +02:00
Lauri Vasama f6d2eaea4b Add Clift DataModelAttr 2026-05-04 10:48:03 +03:00
Lauri Vasama be564f8944 Migrate isIntegerType users to unwrapped_isa 2026-04-30 15:09:16 +03:00
Lauri Vasama 9dced83bd6 Add Clift IntegralType interface 2026-04-30 15:09:16 +03:00
Lauri Vasama 7126513af8 Add CallOp::getFunctionType 2026-04-30 15:09:16 +03:00
Lauri Vasama bbc687fb43 Fix verifyModuleAttr formatting 2026-04-30 15:09:16 +03:00
Lauri Vasama a338194eb7 Move namespace mlir::clift out of namespace mlir 2026-04-27 12:48:24 +03:00
Lauri Vasama 4cadcafa2c Move operand constraints from C++ to tablegen 2026-04-08 12:30:31 +03:00
Lauri Vasama d35e54627c Add Clift ValueType interface
Value types is the set of non-array object types. These types are
assignable, can be used as function parameters, and as return types
(along with void), and in other scenarios where the type must have usual
value-like behaviour with no weirdness (such as array decay).
2026-04-08 12:28:45 +03:00
Lauri Vasama 80731d1a10 Migrate users to new Clift type casts 2026-04-08 12:27:32 +03:00
Lauri Vasama fb3cdbdf38 Rename ValueType to AddressableType 2026-04-08 12:26:18 +03:00
Lauri Vasama 29c935ac90 Replace Clift type category helpers with casts 2026-04-08 12:25:04 +03:00
Lauri Vasama db2b57e867 Add Clift ObjectType type interface 2026-04-08 12:22:33 +03:00
Lauri Vasama 92ad229ff0 Move BytecodeClassAttr into a separate file 2026-04-08 12:21:16 +03:00
Lauri Vasama 9ba90e9b81 Replace ValueType with mlir::Type where applicable
`mlir::Type` is now used as the default C++ type for representing all
MLIR types, even when `ValueType` would be a valid constraint, unless
doing so provides a clear benefit in that specific context.
2026-04-08 12:20:00 +03:00
Lauri Vasama f9a4cb6384 Split up clift::dealias
* `unwrapTypedefs` matches `dealias(T, /*IgnoreQualifiers=*/true)`.
* `collapseTypedefs` matches `dealias(T)`.
2026-04-08 12:18:42 +03:00
Lauri Vasama be8351a17d Split up Clift PrimitiveType
* PrimitiveType is now an interface.
* VoidKind is now VoidType.
* FloatKind is now FloatType.
* The integer kinds are now IntegerType with IntegerKind.
2026-04-08 12:18:10 +03:00
Lauri Vasama a2be1b476a Split up Clift CastOp
* DecayOp - array or function to pointer decay. Not shown in C.
* BitCastOp - bit-preserving conversion. Emitted as bit_cast if
  necessary.
* ExtendOp - zero- or sign-extending conversion from any integer type to
  any wider integer type.
* TruncateOp - truncating conversion from any integer type to any
  narrower integer type.
* PtrResizeOp - resizes a pointer without changing its pointee type.
2026-04-08 12:11:54 +03:00
Lauri Vasama 4cd4de4f83 Improve Clift type tablegen definitions 2026-04-08 11:12:41 +03:00
Lauri Vasama 82ae097c18 Improve Clift operation type constraints 2026-04-08 11:12:41 +03:00
Lauri Vasama 5198af8ba7 Improve Clift free function type property helpers 2026-04-08 11:12:41 +03:00
Lauri Vasama 7219a9f795 Improve clift::isCompleteType 2026-04-08 11:12:41 +03:00
Lauri Vasama 8e72ad8e48 Improve Clift module verification 2026-04-08 11:12:41 +03:00
Lauri Vasama 71f1fa128a Remove unnecessary function type verification 2026-04-08 11:12:41 +03:00
Lauri Vasama 4e4d3bab46 Remove namespace mlir using directives 2026-04-08 11:12:41 +03:00
Lauri Vasama c0b774369b Remove bad comment in CliftOpInterfaces.cpp 2026-04-08 11:12:41 +03:00
Lauri Vasama de0e59b188 Move FunctionOp arg attr verify to model verify 2026-04-08 11:12:41 +03:00
Ivan Krysak 6f02461948 Clift: fix missed getAttributes methods
They are now correctly named `getCAttributes`.
2026-03-27 12:27:16 +00:00
Ivan Krysak 1f5ca9f40e Clift: ensure _REG and _STACK are exclusive 2026-03-27 08:28:46 +00:00
Ivan Krysak c30f309f5e Clift: introduce getMutableComment 2026-03-27 08:09:09 +00:00
Ivan Krysak 7f66f25253 mlir::clift::ClassAttr: add attribute support 2026-03-27 07:19:27 +00:00
Ivan Krysak 928bcdb118 mlir::clift::FunctionType: add attribute support 2026-03-27 07:19:27 +00:00
Ivan Krysak 8a3a2082b5 CAttributeAttr: enforce argument types 2026-03-27 07:19:27 +00:00
Ivan Krysak f4e7d50361 Allow C-Attributes to accept integers and types 2026-03-27 07:18:49 +00:00
Ivan Krysak c789aba269 CliftAttributes: ensure field lifetime is extended 2026-03-27 07:18:49 +00:00
Ivan Krysak 882788deda Clift: make printers/parsers local 2026-03-25 15:42:13 +00:00
Ivan Krysak 1310b6ab62 Clift: append C to attribute classes we emit 2026-03-25 15:42:13 +00:00
Andrea Gussoni cbb3f03910 Clift: fix CastKind::Decay verify
Perform `dealias` over argument operand of the `CastOp`.
2026-03-18 17:25:13 +01:00
Ivan Krysak 3a699abdcf Clift: fix helper misuse 2026-02-25 14:10:44 +01:00
Ivan Krysak 22fe32afa2 Minor improvements 2026-02-25 12:47:27 +01:00
Lauri Vasama 43c0c8435b Fix Clift UnionAttr mutation 2026-02-16 10:34:39 +01:00