You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[MLIR Opt] Polyhedral loop transformations via affine and linalg dialects #665
Implement polyhedral loop nest transformations and Linalg structured operations.
Problem & Goal
C compilers rely on heuristic loop passes that fail across complex structs and non-trivial access strides.
Using MLIR affine and linalg dialects enables exact Presburger relation dependency analysis, multi-level loop tiling, loop skewing, interchange, and operator fusion.
Key Deliverables
Lower Flow loops and tensor operators to linalg.generic and affine.for nests.
Enable algebraic operator fusion (fusing elementwise ops, broadcasts, and reductions into single-pass kernels).
Incremental step merged in #889: elementwise fusion pass (linalg-fuse-elementwise-ops) plus a generator hook emitting linalg.generic for elementwise loops, with a fusion benchmark. Full polyhedral tiling/skewing via the affine dialect remains.
Opened PR #1186 with the first native compiler slice: FLOWC_MLIR_AFFINE=1 lowers eligible static counted loops to affine.for. The default remains scf.for. Bootstrap fixed-point and three-generation self-host checks pass. Full polyhedral tiling, skewing, interchange, and fusion remain.
Opened #1221 with an opt-in --enable-affine-normalization pipeline flag and Flow-native coverage. The slice also fixes the pipeline tool import to use the tracked shared text module. Local suite passes 2/2.
PR #1311 merged at c5dc393. The Flow-native MLIR pipeline now exposes opt-in affine-parallelize coverage and documentation. The pass remains disabled by default.
Activity
mlir: elementwise fusion pass for polyhedral loop optimization (#665) (…
godofecht commentedon Sep 12, 2026
Incremental step merged in #889: elementwise fusion pass (linalg-fuse-elementwise-ops) plus a generator hook emitting linalg.generic for elementwise loops, with a fusion benchmark. Full polyhedral tiling/skewing via the affine dialect remains.
docs: denotational MLIR design, archive tags, AGENTS.md refresh
docs: denotational MLIR design, archive tags, AGENTS.md refresh (#1158)
godofecht commentedon Oct 2, 2026
Opened PR #1186 with the first native compiler slice: FLOWC_MLIR_AFFINE=1 lowers eligible static counted loops to affine.for. The default remains scf.for. Bootstrap fixed-point and three-generation self-host checks pass. Full polyhedral tiling, skewing, interchange, and fusion remain.
godofecht commentedon Oct 2, 2026
Opened #1221 with an opt-in
--enable-affine-normalizationpipeline flag and Flow-native coverage. The slice also fixes the pipeline tool import to use the tracked shared text module. Local suite passes 2/2.godofecht commentedon Oct 2, 2026
Opened #1222 with opt-in affine loop unrolling and explicit factor validation. The Flow-native pipeline suite passes 4/4 locally.
godofecht commentedon Oct 3, 2026
PR #1311 merged at c5dc393. The Flow-native MLIR pipeline now exposes opt-in affine-parallelize coverage and documentation. The pass remains disabled by default.
fix(mlir): reject invalid L2 tiles and oversized register vectors (#665
8 remaining items
fix(mlir): refuse malformed or orphaned affine tile configuration (#665)
test(mlir): malformed native tile env cannot silently fall back (#665)
fix: regenerate bootstrap C after the #736 cache bounds and #665/#666 …
fix(mlir): reject invalid L2 tiles and oversized register vectors (#665
test(mlir): reject inverted L2 tiling (#665)
fix(mlir): refuse malformed or orphaned affine tile configuration (#665)
test(mlir): malformed native tile env cannot silently fall back (#665)
fix: regenerate bootstrap C after the #736 cache checks and #665/#666 …
fix(mlir): reject invalid L2 tiles and oversized register vectors (#665
test(mlir): reject inverted L2 tiling (#665)
fix(mlir): refuse malformed or orphaned affine tile configuration (#665)
test(mlir): malformed native tile env cannot silently fall back (#665)
godofecht commentedon Oct 12, 2026
Completed by #1475. Added tests/mlir/affine_loop_fusion.flow, benchmarks/mlir_fusion/benchmark.flow, and recorded MLIR command goldens.