Skip to content

Expand a whole-aggregate store into per-field stores - #2974

Open
wsmoses wants to merge 1 commit into
pb/split-aggregate-loadfrom
pb/expand-aggregate-store
Open

Expand a whole-aggregate store into per-field stores#2974
wsmoses wants to merge 1 commit into
pb/split-aggregate-loadfrom
pb/expand-aggregate-store

Conversation

@wsmoses

@wsmoses wsmoses commented Aug 26, 2026

Copy link
Copy Markdown
Member

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.store of an llvm.insertvalue chain. 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

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
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.

1 participant