Commit Graph

8 Commits

Author SHA1 Message Date
Pietro Fezzardi abc3f45298 Drop duplicated BitCastOfBitCastPattern
This is now subsumed into CastCollapsingPattern.
2026-05-11 09:32:20 +02:00
Pietro Fezzardi a28e6b8b87 CliftTransforms: add BitCastOfBitCastPattern
Add a Clift expression-rewrite pattern that collapses
`(T2)(T1)x` into `(T2)x` when both casts are BitCastOps. A
matching mlir-lit test is added.
2026-05-08 11:37:10 +02:00
Lauri Vasama 5a538c0f84 Add (*x).m -> x->m expression rewrite 2026-04-30 15:09:16 +03:00
Lauri Vasama 31c80b0625 Fix (&x)->m -> x.m expression rewrite 2026-04-30 15:09:16 +03:00
Andrea Gussoni 4e3af009fe Expressions: fold x[0] into *x
Implement a DDR rewriting for folding the `x[0]` into `*x`, in order
to avoid a useless verbose syntax. Due to concatenation of rewrites, we
will get `&(x[0])` transformed into `x`, which is the rewriting we are
aiming to.
2026-04-14 09:52:07 +02: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 007ae24bb0 Simplify Clift expression pattern definitions 2026-04-08 11:12:41 +03:00
Lauri Vasama 73d7a77442 Add expression rewrite pass 2025-12-05 19:53:41 +02:00