[Mlir-commits] [mlir] [mlir][SCF] Add `RecursiveMemoryEffects` to `scf.reduce` (PR #75314)

Matthias Springer llvmlistbot at llvm.org
Wed Dec 13 17:08:45 PST 2023


matthias-springer wrote:

> It's checked in `wouldOpBeTriviallyDead`, which have special cases for terminators and `SymbolOpInterface` but otherwise just checks memory interfaces. We probably should add something like `DoNotErase` trait and check it in `wouldOpBeTriviallyDead` as well.

Instead of `DoNotErase` I think of it more like a "this op conceptually belongs to the enclosing op" trait. The `Terminator` trait is often used like that. E.g., it is not considered trivially dead presumably because that would make the enclosing op invalid. Also, some transformations (e.g., bufferization) process the enclosing op and its terminators in one go, as if they were one op.

It could be useful to have such a "belongs to the enclosing op" (not sure what to call it) trait. The `Terminator` trait could have it as a dependent trait.


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


More information about the Mlir-commits mailing list