[Mlir-commits] [mlir] [mlir][bufferization] Relax happens-before analysis (PR #223777)
Matthias Springer
llvmlistbot at llvm.org
Tue Sep 15 17:46:33 PDT 2026
================
@@ -267,17 +268,28 @@ static bool isInplaceMemoryWrite(OpOperand &opOperand,
return state.isInPlace(opOperand);
}
-/// Return true if `a` happens before `b`, i.e., `a` or one of its ancestors
-/// properly dominates `b` and `b` is not inside `a`.
-static bool happensBefore(Operation *a, Operation *b,
- const DominanceInfo &domInfo) {
+/// Return true if `a` cannot happen after `b`.
+/// True if `a` properly dominates `b` and `b` is not inside `a`, or if they
+/// are in the same region with no CFG path from `b` to `a`.
+/// `extraBarriers` are extra blocks a path must not cross (bbArg defs:
+/// re-entering the block is a new definition).
----------------
matthias-springer wrote:
Can you add one or more short IR examples here? This function is a bit difficult to understand because of so many negations. ("cannotHappenAfter", "there is no path form B -> A that does not contain ...")
https://github.com/llvm/llvm-project/pull/223777
More information about the Mlir-commits
mailing list