This change allows supporting operations for which we don't get precise aliasing information without the need to insert clone operations. E.g., arith.select.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp | ||
---|---|---|
847 | i should not be incremented when we see a duplicate. |
mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp | ||
---|---|---|
885 | Since the memref that is removed here is guaranteed to alias with the one in the retained list, we need to replace the uses of %0 with arith.ori %arg1, %0. |
mlir/include/mlir/Dialect/Bufferization/IR/BufferizationOps.td | ||
---|---|---|
487–488 | Let's add a paragraph here: The number of variadic memrefs` operands must equal the number of variadic conditions operands.` | |
491–494 | Let's break it up a bit. Something along the lines of: This operation returns a variadic number of `updatedConditions` operands, one updated condition per retained memref. An updated condition indicates the ownership of the respective retained memref. It computed as the disjunction of all `conditions` operands where the corresponding to `memrefs` operand aliases with the retained memref. If the retained memref has no aliases among `memrefs`, the resulting updated condition is 'false' (TODO: explain why). | |
494 | Dot missing | |
498 | Let's add another memref to the retain list to show that the number of retained memrefs does not necessarily have to be 2. | |
mlir/lib/Conversion/BufferizationToMemRef/BufferizationToMemRef.cpp | ||
94 | add: without any retained values and a single memref | |
110 | Let's put an assert(op.getRetained().empty() && "expected no retained memrefs"); just to be safe. Same for "one memref". | |
120 | it | |
121 | memref helper structure | |
122 | replace with: lists (represented as memrefs) to avoid confusion | |
123 | first list | |
123–124 | whether the corresponding | |
124 | second list | |
130 | Ideally renames these as %m0, %m1, %cond0, %cond1, %r0, %r1 | |
138 | can we given them more descriptive names, e.g., %memref_base_pointers | |
335 | not sure what that means | |
341 | descriptive names | |
352 | Add comment: // Zero initialize result buffer | |
356 | also let's use descriptive names here | |
358 | Let's add a comment: // Check for aliasing with retained memrefs | |
371 | Also comment here |
mlir/lib/Conversion/BufferizationToMemRef/BufferizationToMemRef.cpp | ||
---|---|---|
335 | I think this can go away now since we've added comments to the code below and more descriptive names. |
mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp | ||
---|---|---|
776–777 | When an op is changed in-place, it must be wrapped in rewriter.updateRootInPlace. |
add updateRootInPlace and clang-format
mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp | ||
---|---|---|
776–777 | Oh yes, we should not block application of further canonicalizations after this one only because we update in-place. Thanks for the catch, didn't pay enough attention. |
Let's add a paragraph here: The number of variadic memrefs` operands must equal the number of variadic conditions operands.`