-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Quality of life improvements for IR2OC branch #45103
Conversation
base/compiler/optimize.jl
Outdated
@@ -58,10 +58,12 @@ struct InliningState{S <: Union{EdgeTracker, Nothing}, MICache, I<:AbstractInter | |||
interp::I | |||
end | |||
|
|||
source_inferred(@nospecialize(src)) = ccall(:jl_ir_flag_inferred, Bool, (Any,), src) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is_source_inferred
? Also, the src
is currently required to be CodeInfo
or Vector{UInt8}
. Being Any unspecialized value is not legal in jl_ir_flag_inferred
.
They currently affect codegen, so they need to be preserved until we decide to store the environment type somewhere else.
end | ||
|
||
function Core.OpaqueClosure(ir::IRCode, env...; | ||
nargs::Int = length(ir.argtypes)-1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't nargs
be a required argument? I think length(ir.argtypes)-1
doesn't necessarily correspond to the number of actual argument as it can include entries for arbitrary slots.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conceptually only the ir.argtypes that correspond to the arguments have any meaning. We sometimes leave the slottypes in there for convenience, but we should probably stop doing that.
Still tracking down some issues with this branch, but in the meantime, this makes
code_llvm
work and moves the constructor into base, so that users don't have to copy the internal details everywhere. Also makes it possible to specify the return type for the IRCode variant.N.B.: PR is against jb/ircode2oc not master.