[Mlir-commits] [mlir] [mlir] fix affine-loop-fusion has a crash (#76281) (PR #76351)

Rik Huijzer llvmlistbot at llvm.org
Wed Dec 27 22:47:50 PST 2023


================
@@ -205,7 +205,10 @@ static bool isEscapingMemref(Value memref, Block *block) {
   // (e.g., call ops, alias creating ops, etc.).
   return llvm::any_of(memref.getUsers(), [&](Operation *user) {
     // Ignore users outside of `block`.
-    if (block->getParent()->findAncestorOpInRegion(*user)->getBlock() != block)
+    auto ancestorOp = block->getParent()->findAncestorOpInRegion(*user);
----------------
rikhuijzer wrote:

```suggestion
    Operation *ancestorOp = block->getParent()->findAncestorOpInRegion(*user);
```
Using `Operation` instead of `auto` because the type is not completely obvious (<https://llvm.org/docs/CodingStandards.html#use-auto-type-deduction-to-make-code-more-readable>).

Using the pointer declaration (`*`) is something that `clang-tidy` suggested in my editor.

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


More information about the Mlir-commits mailing list