[Mlir-commits] [mlir] [mlir][Bufferization] Accelerate bufferization pass (PR #160655)

Matthias Springer llvmlistbot at llvm.org
Fri Sep 26 00:36:49 PDT 2025


================
@@ -413,12 +414,35 @@ static void setInsertionPointAfter(OpBuilder &b, Value value) {
 /// Determine which OpOperand* will alias with `value` if the op is bufferized
 /// in place. Return all tensor OpOperand* if the op is not bufferizable.
 AliasingOpOperandList AnalysisState::getAliasingOpOperands(Value value) const {
-  if (Operation *op = getOwnerOfValue(value))
-    if (auto bufferizableOp = getOptions().dynCastBufferizableOp(op))
-      return bufferizableOp.getAliasingOpOperands(value, *this);
+  // Lambda to compute aliasing operands
+  auto computeAliasingOpOperands = [&]() -> AliasingOpOperandList {
+    AliasingOpOperandList result;
+    if (Operation *op = getOwnerOfValue(value))
+      if (auto bufferizableOp = getOptions().dynCastBufferizableOp(op))
+        result = bufferizableOp.getAliasingOpOperands(value, *this);
----------------
matthias-springer wrote:

You can just write `return bufferizableOp.getAliasingOpOperands(value, *this);` here and `return ...` at the end of the function.

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


More information about the Mlir-commits mailing list