[all-commits] [llvm/llvm-project] f8be54: [mlir][bufferization] Fix placement walk crashes a...
Matteo Di Iorio via All-commits
all-commits at lists.llvm.org
Fri Oct 2 19:25:53 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: f8be54bc80fc677344e6639493894d32a12f0c47
https://github.com/llvm/llvm-project/commit/f8be54bc80fc677344e6639493894d32a12f0c47
Author: Matteo Di Iorio <matteo.diiorio2 at studio.unibo.it>
Date: 2026-10-03 (Sat, 03 Oct 2026)
Changed paths:
M mlir/lib/Dialect/Bufferization/Transforms/BufferOptimizations.cpp
M mlir/test/Dialect/Bufferization/Transforms/buffer-hoisting.mlir
M mlir/test/Dialect/Bufferization/Transforms/buffer-loop-hoisting.mlir
M mlir/test/Dialect/Bufferization/Transforms/transform-ops.mlir
Log Message:
-----------
[mlir][bufferization] Fix placement walk crashes and invalid captures (#228050)
`findPlacementBlock`, which is shared by `buffer-hoisting` and
`buffer-loop-hoisting`, can move an allocation outside the operation
used to build the liveness analysis. For example, when
`transform.bufferization.buffer_loop_hoisting` targets a `scf.while`,
moving the allocation into the enclosing function block causes the
liveness lookup to crash.
The walk can also cross an `IsIsolatedFromAbove` operation and introduce
an illegal capture, or reach an unreachable enclosing block and
dereference a missing dominator node. The initial reachability check on
the allocation's block doesn't cover that second case.
This PR keeps allocations inside the analysis target and isolated
regions, and stops the walk before querying a dominator node for an
unreachable block. Movement between blocks within the same region
remains allowed.
I've also added regression tests for these cases, plus one that targets
the enclosing function and checks that the allocation still moves out of
the loop. On the base, the scope and unreachable-parent tests crash,
while the isolation test fails verification.
Changes were made by splitting them out of #226951, as suggested during
[review](https://github.com/llvm/llvm-project/pull/226951#pullrequestreview-5372976164).
The failures also reproduce without the exit-alias fallback presented in
that PR.
Validation:
Release build with assertions on macOS, `check-mlir` completed with 4052
passed and one expected failure.
Co-authored-by: Federico Bruzzone <federico.bruzzone.i at gmail.com>
Co-authored-by: Matthias Springer <me at m-sp.org>
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list