[Mlir-commits] [mlir] [MLIR][NFC] Stop depending on func.func in affine LoopUtils via &Region (PR #83325)

Mehdi Amini llvmlistbot at llvm.org
Wed Feb 28 15:08:15 PST 2024


================
@@ -116,6 +116,8 @@ void AffineDataCopyGeneration::runOnBlock(Block *block,
   AffineCopyOptions copyOptions = {generateDma, slowMemorySpace,
                                    fastMemorySpace, tagMemorySpace,
                                    fastMemCapacityBytes};
+  auto &topRegion =
+      block->getParent()->getParentOfType<func::FuncOp>().getBody();
----------------
joker-eph wrote:

`getParentOfType` can fail which needs to be handled (fallback to getParentRegion?), and we also should check for a FunctionOpInterface instead for generality.

(here and everywhere else)

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


More information about the Mlir-commits mailing list