The current BufferPlacement implementation tries to find Alloc and Dealloc operations in order to move them. However, this is a tight coupling to standard-dialect ops which has been removed in this CL.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Please wait for @mehdi_amini to take a look.
| mlir/lib/Transforms/BufferPlacement.cpp | ||
|---|---|---|
| 361 | Would just return work? | |
| 378 | Nit: Error messages start lower case. | |
| mlir/lib/Transforms/BufferPlacement.cpp | ||
|---|---|---|
| 195 | nit: add period after "interface". | |
| 361 | not sure if return would work, but instead of if (allocateEffectInstance == effects.end())
return WalkResult::advance();
auto allocResult = allocateEffectInstance->getValue().cast<OpResult>();
placements.emplace_back(
allocResult, analysis.computeAllocAndDeallocPositions(allocResult));
return WalkResult::advance();
});try doing if (allocateEffectInstance != effects.end()) {
auto allocResult = allocateEffectInstance->getValue().cast<OpResult>();
placements.emplace_back(allocResult,
analysis.computeAllocAndDeallocPositions(allocResult));
}});to get rid of WalkResult::advance() . | |
| 394 | I am a bit confused by these two lines: OpBuilder builder(alloc.getOwner()); builder.setInsertionPointAfter(positions.getDeallocPosition()); the first line creates a builder and sets its insertion point, the second line changes insertion point again. Why not do that in "one hop"? I think i am just confused. | |
Thanks!
LGTM with the other comments addressed
| mlir/lib/Transforms/BufferPlacement.cpp | ||
|---|---|---|
| 366 | Technically I we could have ops allocating two results, seems like you would only see the first? | |
| mlir/lib/Transforms/BufferPlacement.cpp | ||
|---|---|---|
| 366 | Makes sense to me. | |
This should still be Operation* and not OpOperand?