[PATCH] D134425: [NFC] Create a AllocLikeOpInterface and make memref::AllocOp, memref::AllocaOp and gpu::AllocOp implement it.

Uday Bondhugula via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 5 00:35:31 PDT 2022


bondhugula added a comment.

This is looking good to me. Please pull out changes unrelated to AllocLikeOpInterface into a separate revision (the ones just switching to `hasSingleEffect`).



================
Comment at: mlir/lib/Dialect/Affine/Transforms/LoopFusion.cpp:1967
       auto *op = memref.getDefiningOp();
-      if (isa_and_nonnull<memref::AllocOp>(op))
+      if (hasSingleEffect<MemoryEffects::Allocate>(op))
         op->erase();
----------------
This change isn't related to the `AllocLikeOpInterface`; this and other similar changes can go into another revision.


================
Comment at: mlir/lib/Dialect/Affine/Utils/Utils.cpp:1071
+    if (!defOp || (!hasSingleEffect<MemoryEffects::Allocate>(defOp) &&
+                   !isa<memref::GetGlobalOp>(defOp)))
       // TODO: if the memref was returned by a 'call' operation, we
----------------
The change to include `GetGlobalOp` is unrelated to this PR (and not proper as well) - it should be dropped.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134425/new/

https://reviews.llvm.org/D134425



More information about the cfe-commits mailing list