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 | ||
|---|---|---|
| 1124–1137 | 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 | ||
|---|---|---|
| 1136–1138 | 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 | this operation -> op (in backticks) Nit: | |
| mlir/lib/Dialect/GPU/IR/GPUDialect.cpp | ||
| 1132 | Need a code comment here to understand the rationale. | |
| mlir/lib/Interfaces/SideEffectInterfaces.cpp | ||
| 95 | You don't need llvm::. | |
| 95 | Define this small vector below the check. | |
| 102 | Need a code comment here. | |
LGTM
| mlir/lib/Dialect/GPU/IR/GPUDialect.cpp | ||
|---|---|---|
| 1132–1134 | single -> a single | |
this operation -> op (in backticks)
Nit:
only has the ... -> has only the ..