[Mlir-commits] [mlir] [mlir][bufferization] Handle disjoint subsets in One-Shot Analysis (PR #224184)
Ziliang Zhang
llvmlistbot at llvm.org
Mon Sep 21 01:19:20 PDT 2026
ziliangzl wrote:
I ran compile-time measurements before and after this change.
## Revisions
- Before: `9b42c077c209202d4eabdadec461c73c548e822b`
- After: `1e00eb4ed5c39f74bb751822bc4a7cd41be776d1`
The before revision is the parent of the first commit in the PR. The after
revision is the current PR head.
## Environment
- Apple M4, 16 GB RAM
- macOS 26.6.2 (arm64)
- Apple Clang 17.0.0
- CMake `Release`
- `LLVM_ENABLE_ASSERTIONS=OFF`
- `LLVM_TARGETS_TO_BUILD=Native`
Both revisions were checked out into separate detached worktrees and built
from scratch with identical CMake options.
## Method
```text
mlir-opt INPUT \
"-one-shot-bufferize=test-analysis-only bufferize-function-boundaries" \
--mlir-timing --mlir-timing-display=tree -o /dev/null
```
The primary metric is the `OneShotBufferizePass` wall time. Each revision was
warmed up once, followed by seven measured runs in alternating before/after
order. The tables report the median and the minimum-to-maximum range.
## Results
| Workload | Parameters | Before median (range) | After median (range) | Change | Ratio |
| --- | --- | ---: | ---: | ---: | ---: |
| chained vector stress | W=300, R=300 | 2.1361 s (2.1105–2.3585) | 5.3409 s (5.2356–5.3563) | +150.03% | 2.500x |
| 40-level alias-chain stress | W=120, R=120, L=40 | 7.4663 s (7.4434–7.5268) | 15.3605 s (15.1752–15.4438) | +105.73% | 2.057x |
| overlap control | W=120, R=120, L=40 | 0.4590 s (0.4561–0.4855) | 0.5096 s (0.5065–0.5142) | +11.02% | 1.110x |
| direct disjoint success | W=300, R=300 | 0.0661 s (0.0657–0.0673) | 0.0691 s (0.0671–0.0757) | +4.54% | 1.045x |
| 40-level alias disjoint success | W=120, R=120, L=40 | 0.8058 s (0.8020–0.8164) | 0.9337 s (0.8708–1.0097) | +15.87% | 1.159x |
| matched direct success | W=1000, R=1000 | 0.7737 s (0.7652–0.7790) | 0.7973 s (0.7856–0.8094) | +3.05% | 1.031x |
| matched direct failure | W=1000, R=1000 | 0.7811 s (0.7701–0.7992) | 0.7919 s (0.7688–0.7979) | +1.38% | 1.014x |
### Alias-chain scaling
The alias depth is fixed at 40 while the number of reads and writes grows
together.
| W = R | Before median | After median | Change | Ratio |
| ---: | ---: | ---: | ---: | ---: |
| 30 | 0.2015 s | 0.3621 s | +79.70% | 1.797x |
| 60 | 0.9586 s | 2.0534 s | +114.21% | 2.142x |
| 90 | 3.0796 s | 6.5829 s | +113.76% | 2.138x |
| 120 | 7.4663 s | 15.3605 s | +105.73% | 2.057x |
I also packaged the benchmark artifacts as `llvm-subset-benchmark-artifacts.zip`. The archive contains the workload generator, benchmark runner, all generated MLIR inputs, and the raw JSON results. I can share it separately if useful.
https://github.com/llvm/llvm-project/pull/224184
More information about the Mlir-commits
mailing list