mlir: mark loads of read-only pointers as movable during mincut#2734
Open
mlir: mark loads of read-only pointers as movable during mincut#2734
Conversation
Member
pengmai
commented
Mar 11, 2026
- implement MemoryEffectOpInterface for enzyme.push/pop
- fix warnings with int signedness
wsmoses
reviewed
Mar 12, 2026
| "::llvm::cast<enzyme::CacheType>($_self).getType()">]> { | ||
| let summary = "Retrieve information for the reverse mode pass."; | ||
| let arguments = (ins AnyType : $cache); | ||
| let arguments = (ins Arg<AnyType, "the cache to pop from", [MemRead]>:$cache); |
Member
There was a problem hiding this comment.
so this isn't purely memread, because it also removes an element. E.g. we want to avoid accidentally rm'ing a pop just because the result is unused since then indexing will be wrong for other push/pops.
Member
Author
There was a problem hiding this comment.
Would it be sufficient to also add a MemWrite? [MemRead, MemWrite] is how memref.atomic_rmw is defined.
Member
There was a problem hiding this comment.
I think so [cc @ftynse]. technically it more writes to the "length" instead of the actual position, but that is encompoased within the write to a fake -1 index of the stack pointer itself or something
* implement MemoryEffectOpInterface for enzyme.push/pop * fix warnings with int signedness
cb9ca83 to
d850649
Compare
wsmoses
approved these changes
Mar 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.