Skip to content

Conversation

nsajko
Copy link
Member

@nsajko nsajko commented Mar 22, 2025

Should make the code less vulnerable to invalidation.

@nsajko nsajko added invalidations backport 1.12 Change should be backported to release-1.12 labels Mar 22, 2025
@nsajko
Copy link
Member Author

nsajko commented Mar 22, 2025

Prevents these invalidations (the method instance signatures seem identical, but that's what SnoopCompile gives me):

{   
    "method_instance": {
        "method": "abstract_eval_invoke_inst(interp::Compiler.AbstractInterpreter, inst::Compiler.Instruction, irsv::Compiler.IRInterpretationState) @ Compiler ../usr/share/julia/Compiler/src/ssair/irinterp.jl:34",      
        "method_instance": "MethodInstance for Compiler.abstract_eval_invoke_inst(::Compiler.AbstractInterpreter, ::Compiler.Instruction, ::Compiler.IRInterpretationState)"
    },
    "children": [
    ]
},
{
    "method_instance": {
        "method": "abstract_eval_invoke_inst(interp::Compiler.AbstractInterpreter, inst::Compiler.Instruction, irsv::Compiler.IRInterpretationState) @ Compiler ../usr/share/julia/Compiler/src/ssair/irinterp.jl:34",
        "method_instance": "MethodInstance for Compiler.abstract_eval_invoke_inst(::Compiler.NativeInterpreter, ::Compiler.Instruction, ::Compiler.IRInterpretationState)"
    },
    "children": [
    ]
}

The total invalidation count somehow doesn't change, staying at 739.

@KristofferC KristofferC mentioned this pull request Mar 24, 2025
27 tasks
@nsajko nsajko changed the title Compiler: abstract_eval_invoke_inst: type assert Int Compiler: abstract_eval_invoke_inst: type assert Expr Mar 27, 2025
nsajko added 2 commits March 27, 2025 08:23
Should make the code less vulnerable to invalidation.
@nsajko nsajko force-pushed the Compiler_ssair_irinterp_typeassert_Int_before_Colon branch from 40dc34f to 1040d0c Compare March 27, 2025 07:24
@nsajko
Copy link
Member Author

nsajko commented Mar 27, 2025

The latest version of this PR additionally prevents these invalidations 🚀

{
    "method_instance": {
        "method": "isempty(r::StepRange) @ Base range.jl:685",
        "method_instance": "MethodInstance for isempty(::StepRange{Tuple{LineNumberNode, Expr}})"
    },
    "children": [
        {
            "method_instance": {
                "method": "iterate(r::OrdinalRange) @ Base range.jl:917",
                "method_instance": "MethodInstance for iterate(::OrdinalRange{Tuple{LineNumberNode, Expr}})"
            },
            "children": [
                {
                    "method_instance": {
                        "method": "Vector{T}(r::AbstractRange{T}) where T @ Base range.jl:1395",
                        "method_instance": "MethodInstance for Vector{Tuple{LineNumberNode, Expr}}(::AbstractRange{Tuple{LineNumberNode, Expr}})"
                    },
                    "children": [
                    ]
                }
            ]
        }
    ]
}

@topolarity topolarity merged commit ed3fccc into JuliaLang:master Mar 27, 2025
5 of 7 checks passed
@topolarity
Copy link
Member

Thanks @nsajko !

@nsajko nsajko deleted the Compiler_ssair_irinterp_typeassert_Int_before_Colon branch March 27, 2025 14:28
KristofferC pushed a commit that referenced this pull request Mar 31, 2025
Should make the code less vulnerable to invalidation.

(cherry picked from commit ed3fccc)
@KristofferC KristofferC mentioned this pull request Mar 31, 2025
36 tasks
KristofferC pushed a commit that referenced this pull request Mar 31, 2025
Should make the code less vulnerable to invalidation.

(cherry picked from commit ed3fccc)
@KristofferC KristofferC mentioned this pull request Apr 4, 2025
51 tasks
@KristofferC KristofferC removed the backport 1.12 Change should be backported to release-1.12 label Apr 9, 2025
serenity4 pushed a commit to serenity4/julia that referenced this pull request May 1, 2025
…g#57860)

Should make the code less vulnerable to invalidation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants