Erase gpu.memcpy op when only uses of dest are
the memcpy op in question, its allocation and deallocation
ops.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Dialect/GPU/IR/GPUDialect.cpp | ||
---|---|---|
1082–1095 | Can this be made or use a helper method in the mlir Analysis library to the effect: template <typename EffectTy> bool mlir::hasSingleEffect(Operation *op, Value value) { ... } I see numerous use cases for something like all over. if (hasSingleEffect<MemoryEffects::Allocate>()) ... |
Looks good from my side but please address Uday's comments.
mlir/lib/Dialect/GPU/IR/GPUDialect.cpp | ||
---|---|---|
1094–1096 | Just a suggestion, feel free to ignore. |
Looking mostly good. Some minor comments and a question to under the async dep related guard.
mlir/include/mlir/Interfaces/SideEffectInterfaces.h | ||
---|---|---|
251 ↗ | (On Diff #427613) | this operation -> op (in backticks) Nit: |
mlir/lib/Dialect/GPU/IR/GPUDialect.cpp | ||
1090 | Need a code comment here to understand the rationale. | |
mlir/lib/Interfaces/SideEffectInterfaces.cpp | ||
95 ↗ | (On Diff #427613) | You don't need llvm::. |
95 ↗ | (On Diff #427613) | Define this small vector below the check. |
102 ↗ | (On Diff #427613) | Need a code comment here. |
LGTM
mlir/lib/Dialect/GPU/IR/GPUDialect.cpp | ||
---|---|---|
1090–1092 | single -> a single |
This is unclearly phrased.
-> `/// Returns true if EffectTy is the only effect that this operation has on value.`
?