Skip to content

Unify RIR SSA transform into single pass, fix mapping bugs - #3941

Open
Stefan J. Wernli (swernli) wants to merge 1 commit into
swernli/issue3810from
swernli/issue3908
Open

Stefan J. Wernli (swernli) wants to merge 1 commit into
swernli/issue3810from
swernli/issue3908

Conversation

@swernli

Copy link
Copy Markdown
Contributor

This is fixes #3908 with two related RIR pass bugs that needed separate tweaks:

  1. The SSA transform was performed internally via two passes across the blocks (two separate calls to the map_variable_use_in_block utility), but some information was lost after the first pass removed all store instructions. Unifying to a single pass with necessary phi node insertion computed from predecessors ahead of time prevents the loss of context.
  2. For the Adaptive-only pruning of unneeded stores, old variable mappings were persisted even after a store may change what value a variable corresponds to, so removing the mapping when a store is NOT pruned prevents out of date constant values from propagating within a block.

Stack created with GitHub Stacks CLI • Give Feedback 💬

This is fixes #3908 with two related RIR pass bugs that needed separate tweaks:
1. The SSA transform was performed internally via two passes across the blocks (two separate calls to the `map_variable_use_in_block` utility), but some information was lost after the first pass removed all store instructions. Unifying to a single pass with necessary phi node insertion computed from predecessors ahead of time prevents the loss of context.
2. For the Adaptive-only pruning of unneeded stores, old variable mappings were persisted even after a store may change what value a variable corresponds to, so removing the mapping when a store is NOT pruned prevents out of date constant values from propagating within a block.

This branch has not been deployed

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

Adaptive_RI/RIF: a copy of a mutable, read inside a later runtime branch, loses its value

1 participant