[Mlir-commits] [mlir] [mlir] Use a container with deterministic iteration order for unrealized materializations (PR #191323)

Mehdi Amini llvmlistbot at llvm.org
Tue Apr 14 09:33:15 PDT 2026


joker-eph wrote:

> There's [a .keys() call within the dialect conversion](https://github.com/llvm/llvm-project/blob/main/mlir/lib/Transforms/Utils/DialectConversion.cpp#L3250) that performs an iteration, I can offer that as an example

I saw this, but I'd like a chain of reasoning explaining how changing the iteration order here would lead to another behavior of the pass.

> Unfortunately I don't have a sample IR to share (working on some sensitive material) but I can promise that the results on my end show that this fix does result in deterministic run-to-run behaviour

The alternative to a reproducible example can be an analytical explanation of the algorithm showing how it can lead to a different result. If you can provide some sort of walk-through that could help.



We do have the build flag `LLVM_REVERSE_ITERATION` to detect this kind of issue, I'm not sure our CI bots have it though: I'll add it to one of them.
We do have two failures in the test suite right now with this flag, I'll look into them:
```
Failed Tests (2):
  MLIR :: Dialect/LLVMIR/sroa-intrinsics.mlir
  MLIR :: mlir-lsp-server/completion.test
```


https://github.com/llvm/llvm-project/pull/191323


More information about the Mlir-commits mailing list