Commit Graph

12 Commits

Author SHA1 Message Date
Lauri Vasama 7f2bf61d10 Move cast collapsing rewrite to a separate set 2026-04-30 15:09:16 +03:00
Lauri Vasama c151a2c7fd Improve cast collapsing expression rewrite 2026-04-30 15:09:16 +03:00
Lauri Vasama e5fb446430 Rename BooleanNegations.h to Expressions.h 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 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 29c935ac90 Replace Clift type category helpers with casts 2026-04-08 12:25:04 +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
Andrea Gussoni 4952346620 Clift: reject TypePunned for ArrayType
Reject the `assignTypePunnedConstraint` DDR `Expressions.td` rewrite
when the `DstType` is an `ArrayType`, to avoid an invalid rewrite that
would violate the assumption that `bitcast`s do not admit a `ArrayType`
as `result` type.
2026-03-18 17:25:13 +01:00
Lauri Vasama 73d7a77442 Add expression rewrite pass 2025-12-05 19:53:41 +02:00