- Create AllocLikeOpInterface and put the common methods used by memref.alloc, mermen.alloca and gpu.alloc there.
- Instead of checking explicitly for alloc or alloca ops, use hasSingleEffect().
Paths
| Differential D134425
[NFC] Create a AllocLikeOpInterface and make memref::AllocOp, memref::AllocaOp and gpu::AllocOp implement it. Needs RevisionPublic Authored by arnab-oss on Sep 22 2022, 4:12 AM.
Details Summary
Diff Detail
Event TimelineHerald added subscribers: zero9178, bzcheeseman, ThomasRaoux and 21 others. · View Herald Transcript Herald added subscribers: cfe-commits, stephenneuendorffer, nicolasvasilache. · View Herald Transcript arnab-oss retitled this revision from Create a AllocLikeOpInterface and make memref::AllocLikeOp and gpu::AllocOp implement it. to [NFC] Create a AllocLikeOpInterface and make memref::AllocOp, memref::AllocaOp and gpu::AllocOp implement it..Sep 22 2022, 5:00 AM Comment Actions This is looking good to me. Please pull out changes unrelated to AllocLikeOpInterface into a separate revision (the ones just switching to hasSingleEffect).
Comment Actions I would expect a new top-level interface (in lib/Interfaces) to go through the RFC process. I have concerns about the interface design. Specifically, it appears to be promoting details specific to operations from one dialect (memref.alloc(a)) such as the fact that the result of an allocation is a memref (it's not, we have allocations in LLVM and SPIR-V that produce different types), that it has alignment defined as integer, and that it has some symbol operands presumably related to memref's affine layouts. If this were to live in lib/Interfaces, it should make either cover wider range of allocation-like operations or make a clear case as to why this is not desired accompanied by a name change.
This revision now requires changes to proceed.Oct 5 2022, 1:31 AM
Revision Contents
Diff 462137 clang/docs/tools/clang-formatted-files.txt
mlir/include/mlir/Dialect/GPU/IR/GPUDialect.h
mlir/include/mlir/Dialect/GPU/IR/GPUOps.td
mlir/include/mlir/Dialect/MemRef/IR/MemRef.h
mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td
mlir/include/mlir/Interfaces/AllocLikeOpInterface.h
mlir/include/mlir/Interfaces/AllocLikeOpInterface.td
mlir/include/mlir/Interfaces/CMakeLists.txt
mlir/lib/Dialect/Affine/Transforms/LoopFusion.cpp
mlir/lib/Dialect/Affine/Utils/Utils.cpp
mlir/lib/Dialect/Bufferization/Transforms/BufferDeallocation.cpp
mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
mlir/lib/Dialect/MemRef/Transforms/NormalizeMemRefs.cpp
mlir/lib/Interfaces/AllocLikeOpInterface.cpp
mlir/lib/Interfaces/CMakeLists.txt
mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp
utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
|
I suppose these are only necessary because the dialect doesn't emit accessor using the prefixed form? Make sure to rebase this commit because the GPU dialect must have been switched to the prefixed form - https://discourse.llvm.org/t/psa-raw-accessors-are-being-removed/65629.