3 Commits

Author SHA1 Message Date
Marius Brehler
7c63431cc2
[mlir][EmitC] Introduce a CExpression trait (#84177)
This adds a `CExpression` trait and replaces the `isCExpression()`
function.
2024-03-07 08:37:47 +01:00
Matthias Springer
d8d09296ed
[mlir][EmitC] Fix invalid rewriter API usage (#76124)
When operations are modified in-place, the rewriter must be notified.
This commit fixes `mlir/test/Dialect/EmitC/transforms.mlir` when running
with `MLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS` enabled.
2023-12-21 16:00:18 +09:00
Gil Rapaport
d9803841f2
[mlir][emitc] Add op modelling C expressions (#71631)
Add an emitc.expression operation that models C expressions, and provide
transforms to form and fold expressions. The translator emits the body
of
emitc.expression ops as a single C expression.
This expression is emitted by default as the RHS of an EmitC SSA value,
but if
possible, expressions with a single use that is not another expression
are
instead inlined. Specific expression's inlining can be fine tuned by
lowering
passes and transforms.
2023-12-20 15:04:46 +02:00