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

Stop renumbering statements in inference proper #48022

Merged
merged 1 commit into from
Dec 29, 2022
Merged

Conversation

Keno
Copy link
Member

@Keno Keno commented Dec 28, 2022

I don't think there's any good reason to try to delete the statements here. The very next thing we do is to convert to IRCode which drops dead code anyway, so this just seems redundant. In addition, it complicates Cthulhu-like analysis, which now has to track an extra set of statement numbers.

@Keno Keno requested a review from aviatesk December 28, 2022 16:35
@Keno
Copy link
Member Author

Keno commented Dec 28, 2022

@nanosoldier runbenchmarks("inference", vs=":master")

@nanosoldier
Copy link
Collaborator

Your benchmark job has completed - no performance regressions were detected. A full report can be found here.

Copy link
Sponsor Member

@aviatesk aviatesk left a comment

Choose a reason for hiding this comment

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

Well, if I remember correctly, our optimization pass doesn't have an ability to remove dead control flow, so we still want to have this reachability-based optimization enabled?

@@ -742,13 +742,9 @@ function type_annotate!(interp::AbstractInterpreter, sv::InferenceState, run_opt
body[i] = annotate_slot_load!(undefs, i, sv, expr) # 1&2
ssavaluetypes[i] = widenslotwrapper(ssavaluetypes[i]) # 4
else # i.e. any runtime execution will never reach this statement
any_unreachable = true
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Maybe move this assignment into the else block below?

@Keno
Copy link
Member Author

Keno commented Dec 29, 2022

Well, if I remember correctly, our optimization pass doesn't have an ability to remove dead control flow

That's true for things during the optimization, but one of the first things it does it schedule the reachable basic blocks into dominance order, which drops unreachable code.

@vtjnash
Copy link
Sponsor Member

vtjnash commented Dec 29, 2022

SGTM. It was odd to have this optimization here

I don't think there's any good reason to try to delete the statements
here. The very next thing we do is to convert to IRCode which drops
dead code anyway, so this just seems redundant. In addition, it
complicates Cthulhu-like analysis, which now has to track an extra
set of statement numbers.
@Keno Keno merged commit 6740224 into master Dec 29, 2022
@Keno Keno deleted the kf/noextrarenumber branch December 29, 2022 18:13
aviatesk pushed a commit that referenced this pull request Feb 22, 2023
I don't think there's any good reason to try to delete the statements
here. The very next thing we do is to convert to IRCode which drops
dead code anyway, so this just seems redundant. In addition, it
complicates Cthulhu-like analysis, which now has to track an extra
set of statement numbers.
aviatesk added a commit to JuliaDebug/Cthulhu.jl that referenced this pull request Mar 2, 2023
After JuliaLang/julia#48022 the renumbering of `interp.remarks` and
`interp.effects` are unnecessary. This may lead to printing them on
wrong statements.
aviatesk added a commit to JuliaDebug/Cthulhu.jl that referenced this pull request Mar 2, 2023
After JuliaLang/julia#48022 the renumbering of `interp.remarks` and
`interp.effects` are unnecessary. This may lead to printing them on
wrong statements.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:inference Type inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants