This simplifies the op and avoids unnecessary alias checks introduced during the lowering to memref.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp | ||
---|---|---|
887 | To avoid the magic -1, you could make this a SmallVector<Value> and either push the the condition value (if the memref operand is dropped) or {}. Then after creating the new DeallocOp, you can fill in the {} with the new results. I think it makes the pattern a bit simpler because there only one place where the IR is modifed (rewriter.replaceOp(deallocOp, replacements). | |
893 | We should always use the rewriter to modify IR. (rewriter.replaceAllUsesWith) |
mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp | ||
---|---|---|
893 | Right, totally forgot that I'm in a rewrite pattern here. Thanks for the catch! |
To avoid the magic -1, you could make this a SmallVector<Value> and either push the the condition value (if the memref operand is dropped) or {}. Then after creating the new DeallocOp, you can fill in the {} with the new results. I think it makes the pattern a bit simpler because there only one place where the IR is modifed (rewriter.replaceOp(deallocOp, replacements).