Skip to content
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

compiler: eliminate Core.Compiler. qualifier #52790

Merged
merged 1 commit into from
Jan 9, 2024

Conversation

aviatesk
Copy link
Sponsor Member

@aviatesk aviatesk commented Jan 7, 2024

To avoid symbol name clashes, this commit defines and uses partialorder(𝕃::AbstractLattice) = βŠ‘(𝕃). While I have a preference for a 2-arg binary operator for lattice operations, it's currently coexisting with a 3-arg version, suggesting that a unification might be beneficial.

@aviatesk aviatesk requested review from vtjnash and Keno January 7, 2024 10:54
@@ -331,7 +331,7 @@ end
add_tfunc(Core.ifelse, 3, 3, ifelse_tfunc, 1)

@nospecs function ifelse_nothrow(𝕃::AbstractLattice, cond, x, y)
βŠ‘ = Core.Compiler.:βŠ‘(𝕃)
βŠ‘ = partialorder(𝕃)
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, the Compiler.:βŠ‘ is okay, just not Core to make it global. Or this very annoying syntax with let global to rebind it:

julia> using Core.Compiler: βŠ‘

julia> f(𝕃) = (βŠ‘ = let; global βŠ‘; βŠ‘(𝕃); end)
f (generic function with 1 method)

julia> f(𝕃)

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think whether βŠ‘ = partialorder(𝕃) is clearer than βŠ‘ = Compiler.:βŠ‘(𝕃). In the same vein, I'm also thinking about replacing tmerge with βŠ” = join(𝕃). What do you think?

Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems fine too. Though maybe a bit confusing that it is not an optimal join on the 𝕃 (that would be Union), but rather on the complexity co-lattice

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Then, we might consider refactoring to switch to the 2-arg form using partialorder(𝕃) or widening(𝕃) (or weakjoin(𝕃)?). This could turn into a significant refactor, so it might be best to undertake it after finishing the upcoming expected refactors.
Anyway, I would like to move this PR forward for now. @Keno please let me know if you have a preference for the current 3-arg form.

@aviatesk aviatesk merged commit c0c676b into master Jan 9, 2024
4 of 7 checks passed
@aviatesk aviatesk deleted the avi/remove-cc-qualification branch January 9, 2024 15:07
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.

None yet

2 participants