-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
slot2ssa: remove TypedSlot
#50943
slot2ssa: remove TypedSlot
#50943
Commits on Aug 18, 2023
-
slot2ssa: Insert PiNodes based on
bb_vartables
This is the last usage of TypedSlot (we should be clear now to remove that step from the end of type inference now). Compared to the prior scheme, this now inserts PiNodes at every PhiNode corresponding to a given slot, rather than at each load. In principle, that should mean that the types we compute across PhiNodes are more precise than before. I believe that means that all slot uses should be at least as precise as before, but I haven't completely convinced myself yet.
Configuration menu - View commit details
-
Copy full SHA for bc57166 - Browse repository at this point
Copy the full SHA bc57166View commit details -
Since this is now unused by `slot2ssa` downstream, we can happily remove it from the rest of the compiler. There's one more piece of logic that I still need to move downstream: we should use the `bb_vartables` for undefined-ness as well. That will allow us to finally remove the (now incorrectly named) `annotate_slot_load!`
Configuration menu - View commit details
-
Copy full SHA for 28df546 - Browse repository at this point
Copy the full SHA 28df546View commit details -
slot2ssa: Remove type iteration
Now that we have the `bb_vartables` from Inference, we can get a converged (and frequently more precise) result for our inserted PhiNodes directly, instead of trying to compute the fix point in the optimizer. This change also improves the way that we are inserting PiNodes to ensure that they are present in every block that requires them for precision, not just where we are already inserting PhiNodes. This is necessary due to the presence of `Conditional`, which means we may have a refined type in a block even when dominated by a definition whose type was precise outside of the Conditional.
Configuration menu - View commit details
-
Copy full SHA for 677a08e - Browse repository at this point
Copy the full SHA 677a08eView commit details -
slot2ssa: Remove usage of
SLOT_USEDUNDEF
Updates slot2ssa to use the `bb_vartables` for `undef` information. As a bonus, evicts the final usage of `tmerge` in slot2ssa. This also fixes a few crashes from the prior commit, esp. where I was emitting PiNode(UndefToken(), Union{}) or where the PhiC nodes were not being ordered correctly.
Configuration menu - View commit details
-
Copy full SHA for 2058927 - Browse repository at this point
Copy the full SHA 2058927View commit details -
Inference: Always update IR to avoid unreachable jumps
This allows downstream consumers, like the optimizer, to be sure that they are only visiting blocks that Inference also visited. Also update tests and remove some unnused variables in `slot2ssa`.
Configuration menu - View commit details
-
Copy full SHA for 4bd8d35 - Browse repository at this point
Copy the full SHA 4bd8d35View commit details -
test: Remove check for
GotoIfNot
Now that type inference modifies branches to reflect static control flow information, we can't search for the branch that we want to optimize away.
Configuration menu - View commit details
-
Copy full SHA for 3b6d588 - Browse repository at this point
Copy the full SHA 3b6d588View commit details
Commits on Aug 23, 2023
-
inference: Move unreachable branch updates to
convert_to_ircode
This means that inference modifies types and not IR statements themselves. In order to make this happen, we pass have to pass per-statement reachability information to the optimizer. Also fixes up assorted review feedback.
Configuration menu - View commit details
-
Copy full SHA for d1f3980 - Browse repository at this point
Copy the full SHA d1f3980View commit details -
inference: Wrap
unreachable
stmts inConst(...)
We were doing this before, but the previous commit had changed it. The problem is that the optimizer cannot rely on the `unreachable` vector for its external entrypoint. This restores the existing logic so that type inference will give you a result that you can pipe into the optimizer and have it work, although suboptimally since we won't be able to prune any unreachable branches.
Configuration menu - View commit details
-
Copy full SHA for 57fb5ed - Browse repository at this point
Copy the full SHA 57fb5edView commit details
Commits on Aug 24, 2023
-
Move
unreachable
into InferenceStateI think it'd be a more maintainable data flow to have these results collected manually and explicitly passed to the conversion routine for the optimizer, but for now this follows the established pattern and allows us to create a complete OptimizationState from an InferenceState.
Configuration menu - View commit details
-
Copy full SHA for d8d674c - Browse repository at this point
Copy the full SHA d8d674cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4cf7d5e - Browse repository at this point
Copy the full SHA 4cf7d5eView commit details
Commits on Aug 25, 2023
-
Configuration menu - View commit details
-
Copy full SHA for afa7b37 - Browse repository at this point
Copy the full SHA afa7b37View commit details -
Configuration menu - View commit details
-
Copy full SHA for e234e8f - Browse repository at this point
Copy the full SHA e234e8fView commit details