Depends On D111378
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
The purpose of this revision is to make "write into non-writable memory" conflict detection easier to understand.
In particular, I was thinking for a while that the existing code is missing a case.
%r = tensor.extract_slice %t where: * %t aliases in-place write * %r aliases non-writable buffer
This case is not covered by the existing code. The new one does cover it. After some more thinking, I now believe that it is not possible to construct such an example. However, this was not immediately obvious to me. So for the sake of simplicity/understandability, my suggestion would be to go with something similar to this revision.
The main idea here is that there is a conflict in the case of inplace bufferization if:
- Someone writes to (an alias of) opOperand, opResult or to-be-bufferized op writes itself.
- And, opOperand or opResult aliases a non-writable buffer.
Yes makes sense to isolate the logic and give it a good name.
Could you promote parts of your comment to the commit message ?
Also, if one of the cases here is not expected to be possible to write, how about putting a defensive assertion + TODO on the corresponding branch so that if it shows up in the future we don't silently miss it?