Conversation
wsmoses
force-pushed
the
pb/buffer-branches
branch
from
August 30, 2026 13:01
4858cb9 to
8245f4a
Compare
wsmoses
changed the base branch from
pb/buffer-branches
to
pb/buffer-normalizations
August 30, 2026 13:09
wsmoses
force-pushed
the
pb/if-ptr-yields
branch
from
August 30, 2026 13:09
15ed014 to
cf9a46f
Compare
Member
Author
|
Rebased: this branch now carries #3027's expand-buffer-branches commit as its prerequisite on top of pb/buffer-normalizations (the base ref), since the pointer-yield expansion edits that function and its test needs the raw-gep raising from #3006. Merge order: #3006 → #3027 → this. 🤖 Generated with Claude Code |
This was referenced Aug 30, 2026
MFEM's shared scratch selection yields the buffers themselves from an affine.if; the chosen one is converted back to a pointer and viewed again, and the access sits on that view. Follow the conversions from the yield to the access, rebuild them inside each arm on that arm's own buffer, and erase them once the access is gone: they are all that still names the branch, and while they stand it reaches the descent, which refuses a branch choosing between buffers that are written through. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016zErYp7upmqr4NHfhod9UD
wsmoses
changed the base branch from
pb/buffer-normalizations
to
pb/buffer-branches
September 2, 2026 15:32
wsmoses
force-pushed
the
pb/if-ptr-yields
branch
from
September 2, 2026 15:32
3484471 to
5400f00
Compare
This was referenced Sep 2, 2026
wsmoses
added a commit
that referenced
this pull request
Sep 5, 2026
…3016) MFEM's shared scratch selection yields the buffers themselves from an affine.if; the chosen one is converted back to a pointer and viewed again, and the access sits on that view. Follow the conversions from the yield to the access, rebuild them inside each arm on that arm's own buffer, and erase them once the access is gone: they are all that still names the branch, and while they stand it reaches the descent, which refuses a branch choosing between buffers that are written through. (cherry picked from commit 5400f00)
wsmoses
added a commit
that referenced
this pull request
Sep 5, 2026
…xtension) An affine.if may yield the chosen buffer as a pointer rather than a memref; the views taken of that pointer are the accesses that give the branch away. Push each such access into a clone of the branch, viewing that arm's own pointer, the way the memref yields already expand.
wsmoses
added a commit
that referenced
this pull request
Sep 6, 2026
…3016) MFEM's shared scratch selection yields the buffers themselves from an affine.if; the chosen one is converted back to a pointer and viewed again, and the access sits on that view. Follow the conversions from the yield to the access, rebuild them inside each arm on that arm's own buffer, and erase them once the access is gone: they are all that still names the branch, and while they stand it reaches the descent, which refuses a branch choosing between buffers that are written through. (cherry picked from commit 5400f00)
wsmoses
added a commit
that referenced
this pull request
Sep 6, 2026
…xtension) An affine.if may yield the chosen buffer as a pointer rather than a memref; the views taken of that pointer are the accesses that give the branch away. Push each such access into a clone of the branch, viewing that arm's own pointer, the way the memref yields already expand.
wsmoses
added a commit
that referenced
this pull request
Sep 6, 2026
…3016) MFEM's shared scratch selection yields the buffers themselves from an affine.if; the chosen one is converted back to a pointer and viewed again, and the access sits on that view. Follow the conversions from the yield to the access, rebuild them inside each arm on that arm's own buffer, and erase them once the access is gone: they are all that still names the branch, and while they stand it reaches the descent, which refuses a branch choosing between buffers that are written through. (cherry picked from commit 5400f00)
wsmoses
added a commit
that referenced
this pull request
Sep 6, 2026
…xtension) An affine.if may yield the chosen buffer as a pointer rather than a memref; the views taken of that pointer are the accesses that give the branch away. Push each such access into a clone of the branch, viewing that arm's own pointer, the way the memref yields already expand.
wsmoses
added a commit
that referenced
this pull request
Sep 7, 2026
…oes it #3133 splits an access through a branch between buffers inside a GPU wrapper in polygeist-mem2reg, before raising. The raiser's own copy came in with the #2949 squash (it is what #3105 carved out, and #3027/#3016 grew); with it switched off all 145 mfem objects still compile strict, so it goes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016zErYp7upmqr4NHfhod9UD
wsmoses
added a commit
that referenced
this pull request
Sep 7, 2026
…es (#2949) Squash of pb/scalar-cf-raise @ 767c09d onto union2, minus the parts main already carries (#3101 fail-soft, #3102 scf.for raiser, #3103 masked while, #3104 racy stores): what remains is the masked-pick racy refinement and the base expandBufferBranches that #3027/#3016 extend. (cherry picked from commit 9e18dd1)
wsmoses
added a commit
that referenced
this pull request
Sep 7, 2026
…es (#2949) Squash of pb/scalar-cf-raise @ 767c09d onto union2, minus the parts main already carries (#3101 fail-soft, #3102 scf.for raiser, #3103 masked while, #3104 racy stores): what remains is the masked-pick racy refinement and the base expandBufferBranches that #3027/#3016 extend. (cherry picked from commit 9e18dd1) (cherry picked from commit 0f4db9b080c9c15703c6b76fefe081b97150edd6)
wsmoses
added a commit
that referenced
this pull request
Sep 7, 2026
…es (#2949) Squash of pb/scalar-cf-raise @ 767c09d onto union2, minus the parts main already carries (#3101 fail-soft, #3102 scf.for raiser, #3103 masked while, #3104 racy stores): what remains is the masked-pick racy refinement and the base expandBufferBranches that #3027/#3016 extend. (cherry picked from commit 9e18dd1) (cherry picked from commit 008426e)
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.
Stacked on #3027 (
expandBufferBranches); merge that first.When an
affine.ifyields one of two buffers as a memref and the result is only read back throughenzymexla.memref2pointer→enzymexla.pointer2memref(the shape MFEM'sVector/DeviceTensorwrappers produce afterMemref2Pointer2MemrefCast, #3068, has done its part but the intermediate buffer is a different rank), the branch cannot be raised: the yielded memref has no affine access to follow. This extendsexpandBufferBranchesso that a memref result whose users are either directaffine.load/affine.stores, or such accesses through an m2p/p2m chain, is expanded per access — each access is cloned into a freshaffine.ifwith the arm's buffer substituted, the dead chain links are erased, and the original branch disappears.The pointer-yield case (a branch yielding
!llvm.ptrthat is the same base as, or a gep of, the other side) is now handled generally incanonicalize-parallelby #3072 and is no longer part of this PR.Test:
test/lit_tests/raising/if_memref_yield.mlir.Part of #2968.
🤖 Generated with Claude Code
https://claude.ai/code/session_016zErYp7upmqr4NHfhod9UD