Skip to content

Unnecessary gc root slots in generated code #20981

@Keno

Description

@Keno
type foo
    a::Vector{Int64}
end

f(x::foo) = (a = x.a; for i = 1:100; @inbounds a[i] += 1; end)

code_llvm(f, Tuple{foo})

This generates 3 roots. We technically don't need any because there's no safepoints. However, I'd settle for 1 root for now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GCGarbage collectorcompiler:codegenGeneration of LLVM IR and native code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions