-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove type_lift_pass!/OptimizerLattice (#50257)
This pass (which has become somehwat misnamed) was inserting error checks, both for undefined slots and undefrefs from sroa'd getfields (at least in theory - this broke at some point - see #50250). It accomplished this partly by using the OptimizerLattice, which adjoins the `MaybeUndef` lattice element to the ordinary incidence lattice. This lattice element indicates that the SSAValue may potentially have come from an undef slot and gives it special semantics inside `:isdefined` and `:undefcheck`. However, in our more recent formalization of lattices, this element is ill-defined. It is not valid to widen it, because doing so would change semantics and cause crashes. It would be possible to have a correct version of this element, but it would require inverting the meaning (i.e. having all types be maybe-undef and using a NotUndef lattice element). However, such a change would be expensive and not worth it. This has been causing me some headaches downstream when trying to use custom lattices and custom pass pipelines, so I had some extra motivation to do something about it. This PR just does away with all this complexity. SSA conversion and SROA now directly insert the requisite `:throw_undef_if_not` checks. This does increase the size of the IR somewhat earlier in the pipeline, but on the other hand it saves a full scan over the IR later in the pipeline, so it's probably a was overall. While we're here, we fix #50250 by properly inserting the requistie phi nest inside SROA.
- Loading branch information
Showing
18 changed files
with
157 additions
and
334 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.