Skip to content

mlir: mark loads of read-only pointers as movable during mincut#2734

Open
pengmai wants to merge 1 commit intomainfrom
jmp/mincut-aliasing
Open

mlir: mark loads of read-only pointers as movable during mincut#2734
pengmai wants to merge 1 commit intomainfrom
jmp/mincut-aliasing

Conversation

@pengmai
Copy link
Member

@pengmai pengmai commented Mar 11, 2026

  • implement MemoryEffectOpInterface for enzyme.push/pop
  • fix warnings with int signedness

@pengmai pengmai requested review from Pangoraw, ftynse and wsmoses March 11, 2026 20:16
"::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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be sufficient to also add a MemWrite? [MemRead, MemWrite] is how memref.atomic_rmw is defined.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@pengmai pengmai force-pushed the jmp/mincut-aliasing branch from cb9ca83 to d850649 Compare March 12, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants