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

fix a bug preventing inlining of getindex of const globals #35239

Merged
merged 1 commit into from
Mar 25, 2020

Conversation

JeffBezanson
Copy link
Member

@JeffBezanson JeffBezanson commented Mar 23, 2020

For example

julia> const k = [1];

julia> f() = k[1];

julia> @code_typed f()
CodeInfo(
1 ─ %1 = invoke Base.getindex(Main.k::Array{Int64,1}, 1::Int64)::Int64
└──      return %1
) => Int64

Fixes #31460

@JeffBezanson JeffBezanson added bugfix This change fixes an existing bug compiler:optimizer Optimization passes (mostly in base/compiler/ssair/) labels Mar 23, 2020
@JeffBezanson JeffBezanson merged commit 1f78749 into master Mar 25, 2020
@JeffBezanson JeffBezanson deleted the jb/inlineglobals branch March 25, 2020 15:03
@KristofferC KristofferC mentioned this pull request Apr 4, 2020
27 tasks
KristofferC pushed a commit that referenced this pull request Apr 4, 2020
oxinabox pushed a commit to oxinabox/julia that referenced this pull request Apr 8, 2020
ravibitsgoa pushed a commit to ravibitsgoa/julia that referenced this pull request Apr 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This change fixes an existing bug compiler:optimizer Optimization passes (mostly in base/compiler/ssair/)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using a global const changes inlining behavior vs using a parameter
2 participants