Raise through inliner scope wrappers and shape-erasing casts - #2990
Open
wsmoses wants to merge 1 commit into
Open
Raise through inliner scope wrappers and shape-erasing casts#2990wsmoses wants to merge 1 commit into
wsmoses wants to merge 1 commit into
Conversation
The ParallelLower inliners wrap cloned callees in alloca_scope and execute_region ops, sometimes carrying results and a residual CFG with a trap arm. Inline them before raising: branches whose other targets only trap take their one live successor, straight-line blocks merge, and single-block scopes splice into the parent, iterated to a fixed point since the wrappers stack. A shape-erasing memref.cast of a static buffer blocks raising the same way a memory-space cast does: accesses fold to the static source, and a cast of an already-raised buffer raises as the identity on the underlying tensor. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016zErYp7upmqr4NHfhod9UD
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.
Two normalizations MFEM's dfem/lininteg/hdiv kernels need after the ParallelLower fixes:
memref.alloca_scope+scf.execute_regionpairs, sometimes carrying results and a residual CFG whose other arm is an assert trap (cf.switch/cf.cond_brinto a block endingllvm.unreachable). Trap successors are pruned to the one live target, straight-line blocks merge, and single-block scopes splice into the parent — iterated to a fixed point since the wrappers stack.memref.casts stop blocking raising. Amemref<30xf64> -> memref<?xf64>cast of static scratch folds at accesses to the static source (same treatment as memory-space casts), and a cast of an already-raised buffer raises as the identity on the underlying tensor.🤖 Generated with Claude Code
https://claude.ai/code/session_016zErYp7upmqr4NHfhod9UD