-
-
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.
Refine LimitedAccuracy's ⊑ semantics
As discussed in #48030, this is a different attempt to fix the semantics of LimitedAccuracy. This fixes the same test case as #48030, but keeps `LimitedAccuracy` ε smaller than its wrapped lattice element. The primary change here is that now all lattice elements that are strictly `⊑ T` are now also `⊑ LimitedAccuracy(T)`, whereas before that was only true for other `LimitedAccuracy` elements. Quoting the still relevant parts of #48030's commit message: ``` I was investigating some suboptimal inference in Diffractor (which due to its recursive structure over the order of the taken derivative likes to tickle recursion limiting) and noticed that inference was performing some constant propagation, but then discarding the result. Upon further investigation, it turned out that inference had determined the function to be `LimitedAccuracy(...)`, but constprop found out it actually returned `Const`. Now, ordinarily, we don't constprop functions that inference determined to be `LimitedAccuracy`, but this function happened to have `@constprop :aggressive` annotated. Of course, if constprop determines that the function actually terminates, we do want to use that information. We could hardcode this in abstract_call_gf_by_type, but it made me take a closer look at the lattice operations for `LimitedAccuracy`, since in theory `abstract_call_gf_by_type` should prefer a more precise result. ```
- Loading branch information
Showing
4 changed files
with
155 additions
and
36 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