bugc: compose combined debug contexts by gather/flat, not pick#266
Merged
Conversation
combineDebugContexts wrapped multiple combined contexts in `pick`, but pick means "one of these is true (choose one)" — whereas contexts combined here (constant propagation, CSE, read-write merging, block merging) ALL apply simultaneously. That is what `gather` means. Compose correctly per the context-composition guidance: when the combined contexts have disjoint discriminator keys, merge them flat as sibling keys on one object; when a key collides (e.g. two `code` ranges from merged writes), gather them. Enclosing gather/pick wrappers are flattened first so they re-compose rather than nest. Effect: read-write merging (coalesce) now gathers its merged code ranges instead of picking one.
Contributor
|
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.
combineDebugContextswrapped multiple combined contexts in apickcontext. But
pickmeans "one of these alternatives is true — chooseone" (disjunction), whereas the contexts this helper combines — from
constant propagation, common-subexpression elimination, read-write
merging (coalesce), and block merging — all apply simultaneously
(conjunction). That is what
gather(and flat composition) mean.This composes them correctly, following the context-composition guidance:
with sibling keys (the preferred form).
coderanges from merged writes) →gather— they cannot be siblings.Disjoint keys are deliberately not blanket-gathered, which would
re-introduce the over-gathering cleaned up in #258/#259. Enclosing
gather(and legacypick) wrappers are flattened first soaccumulation re-composes rather than nesting.
Effect: read-write merging (coalesce) now
gathers its mergedcoderanges instead ofpick-ing one. The common single-context caseis unchanged (a normal program emits no
gather/pickat O0 or O3).