Expand a whole-aggregate store into per-field stores - #2974
Open
wsmoses wants to merge 1 commit into
Open
Conversation
A device lambda that updates one capture field copies the whole capture into a stack slot through a single aggregate store of an insertvalue chain. Nothing decomposes an aggregate store (only aggregate loads), so the slot stays untyped and every kernel using it fails to raise. Expand the store into one typed store per leaf field through element-typed views; the extractvalues fold against the insertvalue chain, and the piece stores then forward to their loads. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016zErYp7upmqr4NHfhod9UD
wsmoses
force-pushed
the
pb/expand-aggregate-store
branch
from
August 26, 2026 03:17
7bb249e to
dbb9f2f
Compare
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.
A device lambda that updates one capture field (MFEM's quadinterpolator eval kernels adjusting a DeviceTensor extent) copies the whole capture into a stack slot through a single aggregate
affine.storeof anllvm.insertvaluechain. Nothing decomposes an aggregate store — #2933 splits aggregate loads, #2927 forwards piece stores — so the slot stays untyped and every kernel touching it fails to raise (failed to raise operand: llvm.insertvalue ..., the last remaining quadinterpolator class).This expands such a store into one typed store per leaf field through element-typed views, mirroring
SplitAggregateLoad. The extractvalues fold against the insertvalue chain that built the value, and polygeist-mem2reg then forwards the piece stores to their loads.Based on #2933 since it reuses
fieldByteOffset.🤖 Generated with Claude Code
https://claude.ai/code/session_016zErYp7upmqr4NHfhod9UD