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

Increase build precompilation #53682

Merged

Conversation

IanButterworth
Copy link
Member

@IanButterworth IanButterworth commented Mar 9, 2024

  • Bake precompilepkgs into the sysimage
  • Enable compilation in stdlib JLLs @staticfloat I guess this is ok now we have pkgimages?
  • Add some hardcoded precompiles encountered locally

With this there's no compilation loading Pkg

% ./julia --trace-compile=stderr --start=no -q
julia> ]
(@v1.12) pkg> 

Before

% time julia +nightly --start=no --trace-compile=stderr -q -e "using Pkg"
precompile(Tuple{typeof(Base.setindex!), Base.Dict{Symbol, Union{Nothing, Bool, Int64, String}}, Int64, Symbol})
precompile(Tuple{typeof(Base.haskey), Base.Dict{String, Any}, String})
precompile(Tuple{typeof(MbedTLS_jll.__init__)})
precompile(Tuple{typeof(LibSSH2_jll.__init__)})
precompile(Tuple{typeof(LibGit2_jll.__init__)})
precompile(Tuple{typeof(nghttp2_jll.__init__)})
precompile(Tuple{typeof(LibCURL_jll.__init__)})
precompile(Tuple{typeof(MozillaCACerts_jll.__init__)})
precompile(Tuple{typeof(Base.Filesystem.normpath), String, String, Vararg{String}})
precompile(Tuple{typeof(p7zip_jll.__init__)})
precompile(Tuple{typeof(p7zip_jll.init_p7zip_path)})
precompile(Tuple{typeof(Base.append!), Array{String, 1}, Array{String, 1}})
precompile(Tuple{typeof(Base.join), Array{String, 1}, Char})
julia +nightly --start=no --trace-compile=stderr -q -e "using Pkg"  1.48s user 0.40s system 206% cpu 0.910 total

PR

% time ./julia --start=no --trace-compile=stderr -q -e "using Pkg"
./julia --start=no --trace-compile=stderr -q -e "using Pkg"  1.62s user 0.13s system 402% cpu 0.433 total

@IanButterworth IanButterworth force-pushed the ib/precompilepkgs_precompile branch 3 times, most recently from a8d8155 to 59549eb Compare March 10, 2024 22:43
@IanButterworth IanButterworth marked this pull request as ready for review March 10, 2024 23:37
@IanButterworth IanButterworth changed the title Bake precompilepkgs into the sysimage Increase build precompllation Mar 11, 2024
@IanButterworth IanButterworth changed the title Increase build precompllation Increase build precompilation Mar 11, 2024
@IanButterworth IanButterworth force-pushed the ib/precompilepkgs_precompile branch from 3b92b09 to aa03b71 Compare March 11, 2024 02:44
@IanButterworth IanButterworth force-pushed the ib/precompilepkgs_precompile branch from aa03b71 to ef5ba7a Compare March 11, 2024 14:32
@IanButterworth IanButterworth force-pushed the ib/precompilepkgs_precompile branch from ef5ba7a to 00512fb Compare March 12, 2024 14:13
@IanButterworth
Copy link
Member Author

IanButterworth commented Mar 12, 2024

This is hitting 2 failures on test x86_64-linux-gnu and test x86_64-linux-gnuassertrr for which I don't see the link to this PR

@test occursin("int.jl", code)

@test occursin("int.jl", code)

An example failure of the latter test where int.jl isn't found

*** IR Dump Before BeforeOptimizationMarkerPass on [module] ***
; ModuleID = '@eval'
source_filename = "@eval"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128-ni:10:11:12:13"
target triple = "x86_64-unknown-linux-gnu"

@"*Core.Expr#3" = private unnamed_addr constant ptr inttoptr (i64 139683420672416 to ptr), !julia.constgv !0
@"*Core.GlobalRef#4" = private unnamed_addr constant ptr inttoptr (i64 139683454258784 to ptr), !julia.constgv !0
@"*Core.Core#5" = private unnamed_addr constant ptr inttoptr (i64 139683415475936 to ptr), !julia.constgv !0
@"+Core.GlobalRef#6" = private unnamed_addr constant ptr inttoptr (i64 139683472038144 to ptr), !julia.constgv !0
@"jl_global#7" = private unnamed_addr constant ptr inttoptr (i64 139683471417872 to ptr), !julia.constgv !0
@"jl_sym#eval#8" = private unnamed_addr constant ptr inttoptr (i64 139683606695536 to ptr), !julia.constgv !0
@"+Core.Expr#9" = private unnamed_addr constant ptr inttoptr (i64 139683472038560 to ptr), !julia.constgv !0
@"jl_sym#quote#10" = private unnamed_addr constant ptr inttoptr (i64 139683606692120 to ptr), !julia.constgv !0
@"jl_sym#call#11" = private unnamed_addr constant ptr inttoptr (i64 139683606691896 to ptr), !julia.constgv !0
@"jl_sym#escape#12" = private unnamed_addr constant ptr inttoptr (i64 139683606694904 to ptr), !julia.constgv !0

define swiftcc nonnull ptr addrspace(10) @julia_eval_1(ptr nonnull swiftself %pgcstack_arg, ptr addrspace(11) nocapture noundef nonnull readonly align 8 dereferenceable(16) %"__source__::LineNumberNode", ptr addrspace(10) noundef nonnull %"__module__::Module", ptr addrspace(10) noundef nonnull readonly %"ex::Any") #0 !dbg !8 {
top:
  %pgcstack = call ptr @julia.get_pgcstack()
  %current_task = getelementptr inbounds ptr, ptr %pgcstack, i64 -14
  %world_age = getelementptr inbounds i64, ptr %current_task, i64 15
  call void @llvm.dbg.declare(metadata ptr addrspace(11) %"__source__::LineNumberNode", metadata !23, metadata !DIExpression()), !dbg !26
  call void @llvm.dbg.declare(metadata ptr addrspace(10) %"__module__::Module", metadata !24, metadata !DIExpression()), !dbg !26
  call void @llvm.dbg.declare(metadata ptr addrspace(10) %"ex::Any", metadata !25, metadata !DIExpression()), !dbg !26
  %current_task1 = getelementptr inbounds ptr, ptr %pgcstack, i64 -14
  %ptls_field = getelementptr inbounds ptr, ptr %current_task1, i64 16
  %ptls_load = load ptr, ptr %ptls_field, align 8, !tbaa !27
  %0 = getelementptr inbounds ptr, ptr %ptls_load, i64 2
  %safepoint = load ptr, ptr %0, align 8, !tbaa !31, !invariant.load !0
  fence syncscope("singlethread") seq_cst
  call void @julia.safepoint(ptr %safepoint), !dbg !26
  fence syncscope("singlethread") seq_cst
  %"*Core.Expr#3" = load ptr, ptr @"*Core.Expr#3", align 8, !dbg !33, !tbaa !31, !invariant.load !0, !alias.scope !34, !noalias !37
  %1 = getelementptr inbounds ptr addrspace(10), ptr %"*Core.Expr#3", i64 0, !dbg !33
  %"*Core.Expr#32" = load ptr, ptr @"*Core.Expr#3", align 8, !dbg !33, !tbaa !31, !invariant.load !0, !alias.scope !34, !noalias !37
  %2 = getelementptr inbounds ptr addrspace(10), ptr %"*Core.Expr#32", i64 0, !dbg !33
  %"*Core.GlobalRef#4" = load ptr, ptr @"*Core.GlobalRef#4", align 8, !dbg !33, !tbaa !31, !invariant.load !0, !alias.scope !34, !noalias !37
  %3 = getelementptr inbounds ptr addrspace(10), ptr %"*Core.GlobalRef#4", i64 0, !dbg !33
  %"*Core.Core#5" = load ptr, ptr @"*Core.Core#5", align 8, !dbg !33, !tbaa !31, !invariant.load !0, !alias.scope !34, !noalias !37
  %4 = getelementptr inbounds ptr addrspace(10), ptr %"*Core.Core#5", i64 0, !dbg !33
  %"+Core.GlobalRef#6" = load ptr, ptr @"+Core.GlobalRef#6", align 8, !dbg !33, !tbaa !31, !invariant.load !0, !alias.scope !34, !noalias !37, !nonnull !0, !dereferenceable !42, !align !43
  %5 = addrspacecast ptr %"+Core.GlobalRef#6" to ptr addrspace(10), !dbg !33
  %"jl_global#7" = load ptr, ptr @"jl_global#7", align 8, !dbg !33, !tbaa !31, !invariant.load !0, !alias.scope !34, !noalias !37, !nonnull !0
  %6 = addrspacecast ptr %"jl_global#7" to ptr addrspace(10), !dbg !33
  %"jl_sym#eval#8" = load ptr, ptr @"jl_sym#eval#8", align 8, !dbg !33, !tbaa !31, !invariant.load !0, !alias.scope !34, !noalias !37, !nonnull !0
  %7 = addrspacecast ptr %"jl_sym#eval#8" to ptr addrspace(10), !dbg !33
  %8 = call nonnull ptr addrspace(10) (ptr, ptr addrspace(10), ...) @julia.call(ptr @ijl_apply_generic, ptr addrspace(10) %5, ptr addrspace(10) %6, ptr addrspace(10) %7), !dbg !33
  %"*Core.Expr#33" = load ptr, ptr @"*Core.Expr#3", align 8, !dbg !33, !tbaa !31, !invariant.load !0, !alias.scope !34, !noalias !37
  %9 = getelementptr inbounds ptr addrspace(10), ptr %"*Core.Expr#33", i64 0, !dbg !33
  %"+Core.Expr#9" = load ptr, ptr @"+Core.Expr#9", align 8, !dbg !33, !tbaa !31, !invariant.load !0, !alias.scope !34, !noalias !37, !nonnull !0, !dereferenceable !42, !align !43
  %10 = addrspacecast ptr %"+Core.Expr#9" to ptr addrspace(10), !dbg !33
  %"jl_sym#quote#10" = load ptr, ptr @"jl_sym#quote#10", align 8, !dbg !33, !tbaa !31, !invariant.load !0, !alias.scope !34, !noalias !37, !nonnull !0
  %11 = addrspacecast ptr %"jl_sym#quote#10" to ptr addrspace(10), !dbg !33
  %12 = call nonnull ptr addrspace(10) (ptr, ptr addrspace(10), ...) @julia.call(ptr @ijl_apply_generic, ptr addrspace(10) %10, ptr addrspace(10) %11, ptr addrspace(10) %"ex::Any"), !dbg !33
  %"+Core.Expr#94" = load ptr, ptr @"+Core.Expr#9", align 8, !dbg !33, !tbaa !31, !invariant.load !0, !alias.scope !34, !noalias !37, !nonnull !0, !dereferenceable !42, !align !43
  %13 = addrspacecast ptr %"+Core.Expr#94" to ptr addrspace(10), !dbg !33
  %"jl_sym#call#11" = load ptr, ptr @"jl_sym#call#11", align 8, !dbg !33, !tbaa !31, !invariant.load !0, !alias.scope !34, !noalias !37, !nonnull !0
  %14 = addrspacecast ptr %"jl_sym#call#11" to ptr addrspace(10), !dbg !33
  %15 = call nonnull ptr addrspace(10) (ptr, ptr addrspace(10), ...) @julia.call(ptr @ijl_apply_generic, ptr addrspace(10) %13, ptr addrspace(10) %14, ptr addrspace(10) %8, ptr addrspace(10) %"__module__::Module", ptr addrspace(10) %12), !dbg !33
  %"+Core.Expr#95" = load ptr, ptr @"+Core.Expr#9", align 8, !dbg !33, !tbaa !31, !invariant.load !0, !alias.scope !34, !noalias !37, !nonnull !0, !dereferenceable !42, !align !43
  %16 = addrspacecast ptr %"+Core.Expr#95" to ptr addrspace(10), !dbg !33
  %"jl_sym#escape#12" = load ptr, ptr @"jl_sym#escape#12", align 8, !dbg !33, !tbaa !31, !invariant.load !0, !alias.scope !34, !noalias !37, !nonnull !0
  %17 = addrspacecast ptr %"jl_sym#escape#12" to ptr addrspace(10), !dbg !33
  %18 = call nonnull ptr addrspace(10) (ptr, ptr addrspace(10), ...) @julia.call(ptr @ijl_apply_generic, ptr addrspace(10) %16, ptr addrspace(10) %17, ptr addrspace(10) %15), !dbg !33
  ret ptr addrspace(10) %18, !dbg !33
}

; Function Attrs: noinline optnone
define nonnull ptr addrspace(10) @"jfptr_@eval_2"(ptr addrspace(10) %"function::Core.Function", ptr noalias nocapture noundef readonly %"args::Any[]", i32 %"nargs::UInt32") #1 {
top:
  %pgcstack = call ptr @julia.get_pgcstack()
  %0 = getelementptr inbounds ptr addrspace(10), ptr %"args::Any[]", i32 0
  %1 = load ptr addrspace(10), ptr %0, align 8, !tbaa !31, !invariant.load !0, !alias.scope !34, !noalias !37, !nonnull !0, !dereferenceable !43, !align !44
  %2 = addrspacecast ptr addrspace(10) %1 to ptr addrspace(11)
  %3 = getelementptr inbounds ptr addrspace(10), ptr %"args::Any[]", i32 1
  %4 = load ptr addrspace(10), ptr %3, align 8, !tbaa !31, !invariant.load !0, !alias.scope !34, !noalias !37, !nonnull !0
  %5 = getelementptr inbounds ptr addrspace(10), ptr %"args::Any[]", i32 2
  %6 = load ptr addrspace(10), ptr %5, align 8, !tbaa !31, !invariant.load !0, !alias.scope !34, !noalias !37, !nonnull !0
  %7 = call swiftcc nonnull ptr addrspace(10) @julia_eval_1(ptr nonnull swiftself %pgcstack, ptr addrspace(11) nocapture readonly %2, ptr addrspace(10) %4, ptr addrspace(10) readonly %6)
  ret ptr addrspace(10) %7
}

declare ptr @julia.get_pgcstack()

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare void @llvm.dbg.declare(metadata, metadata, metadata) #2

; Function Attrs: memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @julia.safepoint(ptr) #3

declare nonnull ptr addrspace(10) @ijl_apply_generic(ptr addrspace(10), ptr noalias nocapture noundef readonly, i32)

declare nonnull ptr addrspace(10) @julia.call(ptr, ptr addrspace(10), ...)

attributes #0 = { "frame-pointer"="all" "julia.fsig"="var\22@eval\22(LineNumberNode, Module, Any)" "probe-stack"="inline-asm" }
attributes #1 = { noinline optnone "frame-pointer"="all" "probe-stack"="inline-asm" }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { memory(argmem: readwrite, inaccessiblemem: readwrite) }

!llvm.module.flags = !{!1, !2, !3, !4, !5}
!llvm.dbg.cu = !{!6}

!0 = !{}
!1 = !{i32 2, !"Dwarf Version", i32 4}
!2 = !{i32 2, !"Debug Info Version", i32 3}
!3 = !{i32 2, !"julia.debug_level", i32 2}
!4 = !{i32 1, !"julia.__jit_debug_tsm_addr", i64 140730268202272}
!5 = !{i32 2, !"julia.optlevel", i32 2}
!6 = distinct !DICompileUnit(language: DW_LANG_Julia, file: !7, producer: "julia", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, nameTableKind: GNU)
!7 = !DIFile(filename: "julia", directory: ".")
!8 = distinct !DISubprogram(name: "@eval", linkageName: "julia_eval_1", scope: null, file: !9, line: 444, type: !10, scopeLine: 444, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !6, retainedNodes: !21)
!9 = !DIFile(filename: "essentials.jl", directory: ".")
!10 = !DISubroutineType(types: !11)
!11 = !{!12, !16, !17, !20, !12}
!12 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !13, size: 64, align: 64)
!13 = !DICompositeType(tag: DW_TAG_structure_type, name: "jl_value_t", file: !14, line: 71, align: 64, elements: !15)
!14 = !DIFile(filename: "julia.h", directory: "")
!15 = !{!12}
!16 = !DICompositeType(tag: DW_TAG_structure_type, name: "#@eval", align: 8, elements: !0, runtimeLang: DW_LANG_Julia, identifier: "139683411563504")
!17 = !DICompositeType(tag: DW_TAG_structure_type, name: "LineNumberNode", size: 128, align: 64, elements: !18, runtimeLang: DW_LANG_Julia, identifier: "139683472037056")
!18 = !{!19, !12}
!19 = !DIBasicType(name: "Int64", size: 64, encoding: DW_ATE_unsigned)
!20 = !DIDerivedType(tag: DW_TAG_typedef, name: "Module", baseType: !12)
!21 = !{!22, !23, !24, !25}
!22 = !DILocalVariable(name: "#self#", arg: 1, scope: !8, file: !9, line: 444, type: !16)
!23 = !DILocalVariable(name: "__source__", arg: 2, scope: !8, file: !9, line: 444, type: !17)
!24 = !DILocalVariable(name: "__module__", arg: 3, scope: !8, file: !9, line: 444, type: !20)
!25 = !DILocalVariable(name: "ex", arg: 4, scope: !8, file: !9, line: 444, type: !12)
!26 = !DILocation(line: 444, scope: !8)
!27 = !{!28, !28, i64 0}
!28 = !{!"jtbaa_gcframe", !29, i64 0}
!29 = !{!"jtbaa", !30, i64 0}
!30 = !{!"jtbaa"}
!31 = !{!32, !32, i64 0, i64 1}
!32 = !{!"jtbaa_const", !29, i64 0}
!33 = !DILocation(line: 445, scope: !8)
!34 = !{!35}
!35 = !{!"jnoalias_const", !36}
!36 = !{!"jnoalias"}
!37 = !{!38, !39, !40, !41}
!38 = !{!"jnoalias_gcframe", !36}
!39 = !{!"jnoalias_stack", !36}
!40 = !{!"jnoalias_data", !36}
!41 = !{!"jnoalias_typemd", !36}
!42 = !{i64 56}
!43 = !{i64 16}
!44 = !{i64 8}
*** IR Dump Before BeforeOptimizationMarkerPass on [module] ***
; ModuleID = 'show'
source_filename = "show"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128-ni:10:11:12:13"
target triple = "x86_64-unknown-linux-gnu"

@jl_nothing = external constant ptr
@"*Main.Base.stdout#15" = private unnamed_addr constant ptr inttoptr (i64 139683418987840 to ptr), !julia.constgv !0
@"*Main.Base.show#16" = private unnamed_addr constant ptr inttoptr (i64 139683426315664 to ptr), !julia.constgv !0
@"jl_global#17" = private unnamed_addr constant ptr inttoptr (i64 139683426315744 to ptr), !julia.constgv !0

define swiftcc void @julia_show_13(ptr nonnull swiftself %pgcstack_arg, i64 signext %"x::Int64") #0 !dbg !8 {
top:
  %pgcstack = call ptr @julia.get_pgcstack()
  %current_task = getelementptr inbounds ptr, ptr %pgcstack, i64 -14
  %world_age = getelementptr inbounds i64, ptr %current_task, i64 15
  call void @llvm.dbg.value(metadata i64 %"x::Int64", metadata !17, metadata !DIExpression()), !dbg !18
  %current_task1 = getelementptr inbounds ptr, ptr %pgcstack, i64 -14
  %ptls_field = getelementptr inbounds ptr, ptr %current_task1, i64 16
  %ptls_load = load ptr, ptr %ptls_field, align 8, !tbaa !19
  %0 = getelementptr inbounds ptr, ptr %ptls_load, i64 2
  %safepoint = load ptr, ptr %0, align 8, !tbaa !23, !invariant.load !0
  fence syncscope("singlethread") seq_cst
  call void @julia.safepoint(ptr %safepoint), !dbg !18
  fence syncscope("singlethread") seq_cst
  %"*Main.Base.stdout#15" = load ptr, ptr @"*Main.Base.stdout#15", align 8, !dbg !18, !tbaa !23, !invariant.load !0, !alias.scope !25, !noalias !28
  %1 = getelementptr inbounds ptr addrspace(10), ptr %"*Main.Base.stdout#15", i64 0, !dbg !18
  %stdout = load atomic ptr addrspace(10), ptr %1 unordered, align 8, !dbg !18, !tbaa !33, !alias.scope !36, !noalias !37
  %"*Main.Base.show#16" = load ptr, ptr @"*Main.Base.show#16", align 8, !dbg !18, !tbaa !23, !invariant.load !0, !alias.scope !25, !noalias !28
  %2 = getelementptr inbounds ptr addrspace(10), ptr %"*Main.Base.show#16", i64 0, !dbg !18
  %"jl_global#17" = load ptr, ptr @"jl_global#17", align 8, !dbg !18, !tbaa !23, !invariant.load !0, !alias.scope !25, !noalias !28, !nonnull !0
  %3 = addrspacecast ptr %"jl_global#17" to ptr addrspace(10), !dbg !18
  %box_Int64 = call nonnull align 8 dereferenceable(8) ptr addrspace(10) @ijl_box_int64(i64 signext %"x::Int64") #4, !dbg !18
  %4 = call nonnull ptr addrspace(10) (ptr, ptr addrspace(10), ...) @julia.call(ptr @ijl_apply_generic, ptr addrspace(10) %3, ptr addrspace(10) %stdout, ptr addrspace(10) %box_Int64), !dbg !18
  ret void, !dbg !18
}

; Function Attrs: noinline optnone
define nonnull ptr addrspace(10) @jfptr_show_14(ptr addrspace(10) %"function::Core.Function", ptr noalias nocapture noundef readonly %"args::Any[]", i32 %"nargs::UInt32") #1 {
top:
  %pgcstack = call ptr @julia.get_pgcstack()
  %0 = getelementptr inbounds ptr addrspace(10), ptr %"args::Any[]", i32 0
  %1 = load ptr addrspace(10), ptr %0, align 8, !tbaa !23, !invariant.load !0, !alias.scope !25, !noalias !28, !nonnull !0, !dereferenceable !38, !align !38
  %2 = addrspacecast ptr addrspace(10) %1 to ptr addrspace(11)
  %3 = load i64, ptr addrspace(11) %2, align 8
  call swiftcc void @julia_show_13(ptr nonnull swiftself %pgcstack, i64 signext %3)
  %jl_nothing = load ptr, ptr @jl_nothing, align 8, !tbaa !23, !invariant.load !0, !alias.scope !25, !noalias !28, !nonnull !0
  %4 = addrspacecast ptr %jl_nothing to ptr addrspace(10)
  ret ptr addrspace(10) %4
}

declare ptr @julia.get_pgcstack()

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare void @llvm.dbg.value(metadata, metadata, metadata) #2

; Function Attrs: memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @julia.safepoint(ptr) #3

declare nonnull ptr addrspace(10) @ijl_apply_generic(ptr addrspace(10), ptr noalias nocapture noundef readonly, i32)

declare nonnull ptr addrspace(10) @julia.call(ptr, ptr addrspace(10), ...)

; Function Attrs: nounwind willreturn memory(inaccessiblemem: readwrite)
declare nonnull align 8 dereferenceable(8) ptr addrspace(10) @ijl_box_int64(i64 signext) #4

attributes #0 = { "frame-pointer"="all" "julia.fsig"="show(Int64)" "probe-stack"="inline-asm" }
attributes #1 = { noinline optnone "frame-pointer"="all" "probe-stack"="inline-asm" }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { memory(argmem: readwrite, inaccessiblemem: readwrite) }
attributes #4 = { nounwind willreturn memory(inaccessiblemem: readwrite) }

!llvm.module.flags = !{!1, !2, !3, !4, !5}
!llvm.dbg.cu = !{!6}

!0 = !{}
!1 = !{i32 2, !"Dwarf Version", i32 4}
!2 = !{i32 2, !"Debug Info Version", i32 3}
!3 = !{i32 2, !"julia.debug_level", i32 2}
!4 = !{i32 1, !"julia.__jit_debug_tsm_addr", i64 140730268203952}
!5 = !{i32 2, !"julia.optlevel", i32 2}
!6 = distinct !DICompileUnit(language: DW_LANG_Julia, file: !7, producer: "julia", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, nameTableKind: GNU)
!7 = !DIFile(filename: "julia", directory: ".")
!8 = distinct !DISubprogram(name: "show", linkageName: "julia_show_13", scope: null, file: !9, line: 476, type: !10, scopeLine: 476, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !6, retainedNodes: !15)
!9 = !DIFile(filename: "show.jl", directory: ".")
!10 = !DISubroutineType(types: !11)
!11 = !{!12, !13, !14}
!12 = !DICompositeType(tag: DW_TAG_structure_type, name: "Nothing", align: 8, elements: !0, runtimeLang: DW_LANG_Julia, identifier: "139683472034064")
!13 = !DICompositeType(tag: DW_TAG_structure_type, name: "#show", align: 8, elements: !0, runtimeLang: DW_LANG_Julia, identifier: "139683449316672")
!14 = !DIBasicType(name: "Int64", size: 64, encoding: DW_ATE_unsigned)
!15 = !{!16, !17}
!16 = !DILocalVariable(name: "#self#", arg: 1, scope: !8, file: !9, line: 476, type: !13)
!17 = !DILocalVariable(name: "x", arg: 2, scope: !8, file: !9, line: 476, type: !14)
!18 = !DILocation(line: 476, scope: !8)
!19 = !{!20, !20, i64 0}
!20 = !{!"jtbaa_gcframe", !21, i64 0}
!21 = !{!"jtbaa", !22, i64 0}
!22 = !{!"jtbaa"}
!23 = !{!24, !24, i64 0, i64 1}
!24 = !{!"jtbaa_const", !21, i64 0}
!25 = !{!26}
!26 = !{!"jnoalias_const", !27}
!27 = !{!"jnoalias"}
!28 = !{!29, !30, !31, !32}
!29 = !{!"jnoalias_gcframe", !27}
!30 = !{!"jnoalias_stack", !27}
!31 = !{!"jnoalias_data", !27}
!32 = !{!"jnoalias_typemd", !27}
!33 = !{!34, !34, i64 0}
!34 = !{!"jtbaa_binding", !35, i64 0}
!35 = !{!"jtbaa_data", !21, i64 0}
!36 = !{!31}
!37 = !{!29, !30, !32, !26}
!38 = !{i64 8}
*** IR Dump Before BeforeOptimizationMarkerPass on [module] ***
; ModuleID = 'show'
source_filename = "show"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128-ni:10:11:12:13"
target triple = "x86_64-unknown-linux-gnu"

@jl_nothing = external constant ptr
@"*Main.Base.string#20" = private unnamed_addr constant ptr inttoptr (i64 139683419122544 to ptr), !julia.constgv !0
@"*Main.Base.#string#524#21" = private unnamed_addr constant ptr inttoptr (i64 139683469958432 to ptr), !julia.constgv !0
@"*Core.sizeof#22" = private unnamed_addr constant ptr inttoptr (i64 139683461692528 to ptr), !julia.constgv !0
@"*Core.Intrinsics.bitcast#23" = private unnamed_addr constant ptr inttoptr (i64 139683445272864 to ptr), !julia.constgv !0
@"*Core.getfield#24" = private unnamed_addr constant ptr inttoptr (i64 139683409598336 to ptr), !julia.constgv !0
@"*Main.Base.unsafe_write#25" = private unnamed_addr constant ptr inttoptr (i64 139683454208944 to ptr), !julia.constgv !0
@"*Core.nothing#26" = private unnamed_addr constant ptr inttoptr (i64 139683412922736 to ptr), !julia.constgv !0

define swiftcc void @julia_show_18(ptr nonnull swiftself %pgcstack_arg, ptr addrspace(11) nocapture noundef nonnull readonly align 8 dereferenceable(16) %"io::IOContext", i64 signext %"n::Int64") #0 !dbg !8 {
top:
  %pgcstack = call ptr @julia.get_pgcstack()
  %current_task = getelementptr inbounds ptr, ptr %pgcstack, i64 -14
  %world_age = getelementptr inbounds i64, ptr %current_task, i64 15
  call void @llvm.dbg.declare(metadata ptr addrspace(11) %"io::IOContext", metadata !23, metadata !DIExpression()), !dbg !25
  call void @llvm.dbg.value(metadata i64 %"n::Int64", metadata !24, metadata !DIExpression()), !dbg !25
  %current_task1 = getelementptr inbounds ptr, ptr %pgcstack, i64 -14
  %ptls_field = getelementptr inbounds ptr, ptr %current_task1, i64 16
  %ptls_load = load ptr, ptr %ptls_field, align 8, !tbaa !26
  %0 = getelementptr inbounds ptr, ptr %ptls_load, i64 2
  %safepoint = load ptr, ptr %0, align 8, !tbaa !30, !invariant.load !0
  fence syncscope("singlethread") seq_cst
  call void @julia.safepoint(ptr %safepoint), !dbg !25
  fence syncscope("singlethread") seq_cst
  %"*Main.Base.string#20" = load ptr, ptr @"*Main.Base.string#20", align 8, !dbg !25, !tbaa !30, !invariant.load !0, !alias.scope !32, !noalias !35
  %1 = getelementptr inbounds ptr addrspace(10), ptr %"*Main.Base.string#20", i64 0, !dbg !25
  %"*Main.Base.#string#524#21" = load ptr, ptr @"*Main.Base.#string#524#21", align 8, !dbg !40, !tbaa !30, !invariant.load !0, !alias.scope !32, !noalias !35
  %2 = getelementptr inbounds ptr addrspace(10), ptr %"*Main.Base.#string#524#21", i64 0, !dbg !40
  %3 = call swiftcc nonnull ptr addrspace(10) @"jlsys_#string#524_0"(ptr nonnull swiftself %pgcstack, i64 signext 10, i64 signext 1, i64 signext %"n::Int64"), !dbg !40
  %4 = call token (...) @llvm.julia.gc_preserve_begin(ptr addrspace(10) %3), !dbg !44
  %5 = addrspacecast ptr addrspace(10) %3 to ptr addrspace(11), !dbg !47
  %6 = call nonnull ptr @julia.pointer_from_objref(ptr addrspace(11) %5) #5, !dbg !47
  %7 = getelementptr inbounds ptr addrspace(10), ptr %6, i32 1, !dbg !47
  %string_ptr = ptrtoint ptr %7 to i64, !dbg !47
  %"*Core.sizeof#22" = load ptr, ptr @"*Core.sizeof#22", align 8, !dbg !53, !tbaa !30, !invariant.load !0, !alias.scope !32, !noalias !35
  %8 = getelementptr inbounds ptr addrspace(10), ptr %"*Core.sizeof#22", i64 0, !dbg !53
  %sizeof = load i64, ptr addrspace(10) %3, align 8, !dbg !53, !tbaa !30, !range !56, !invariant.load !0, !alias.scope !32, !noalias !35
  %"*Core.Intrinsics.bitcast#23" = load ptr, ptr @"*Core.Intrinsics.bitcast#23", align 8, !dbg !57, !tbaa !30, !invariant.load !0, !alias.scope !32, !noalias !35
  %9 = getelementptr inbounds ptr addrspace(10), ptr %"*Core.Intrinsics.bitcast#23", i64 0, !dbg !57
  br label %L8, !dbg !60

L8:                                               ; preds = %top
  br label %L9, !dbg !60

L9:                                               ; preds = %L8
  br label %L10, !dbg !60

L10:                                              ; preds = %L9
  br label %L11, !dbg !60

L11:                                              ; preds = %L10
  br label %L12, !dbg !60

L12:                                              ; preds = %L11
  br label %L13, !dbg !60

L13:                                              ; preds = %L12
  %"*Core.getfield#24" = load ptr, ptr @"*Core.getfield#24", align 8, !dbg !67, !tbaa !30, !invariant.load !0, !alias.scope !32, !noalias !35
  %10 = getelementptr inbounds ptr addrspace(10), ptr %"*Core.getfield#24", i64 0, !dbg !67
  %"io::IOContext.io_ptr" = getelementptr inbounds [2 x ptr addrspace(10)], ptr addrspace(11) %"io::IOContext", i32 0, i32 0, !dbg !67
  %"io::IOContext.io" = load atomic ptr addrspace(10), ptr addrspace(11) %"io::IOContext.io_ptr" unordered, align 8, !dbg !67, !tbaa !30, !invariant.load !0, !alias.scope !32, !noalias !35, !nonnull !0, !dereferenceable !68, !align !69
  br label %L15, !dbg !67

L15:                                              ; preds = %L13
  br label %L16, !dbg !67

L16:                                              ; preds = %L15
  %"*Main.Base.unsafe_write#25" = load ptr, ptr @"*Main.Base.unsafe_write#25", align 8, !dbg !65, !tbaa !30, !invariant.load !0, !alias.scope !32, !noalias !35
  %11 = getelementptr inbounds ptr addrspace(10), ptr %"*Main.Base.unsafe_write#25", i64 0, !dbg !65
  %12 = call swiftcc i64 @jlsys_unsafe_write_1(ptr nonnull swiftself %pgcstack, ptr addrspace(10) %"io::IOContext.io", i64 zeroext %string_ptr, i64 zeroext %sizeof), !dbg !65
  br label %L18, !dbg !65

L18:                                              ; preds = %L16
  call void @llvm.julia.gc_preserve_end(token %4), !dbg !44
  br label %L20, !dbg !44

L20:                                              ; preds = %L18
  %"*Core.nothing#26" = load ptr, ptr @"*Core.nothing#26", align 8, !dbg !44, !tbaa !30, !invariant.load !0, !alias.scope !32, !noalias !35
  %13 = getelementptr inbounds ptr addrspace(10), ptr %"*Core.nothing#26", i64 0, !dbg !44
  ret void, !dbg !44
}

; Function Attrs: noinline optnone
define nonnull ptr addrspace(10) @jfptr_show_19(ptr addrspace(10) %"function::Core.Function", ptr noalias nocapture noundef readonly %"args::Any[]", i32 %"nargs::UInt32") #1 {
top:
  %pgcstack = call ptr @julia.get_pgcstack()
  %0 = getelementptr inbounds ptr addrspace(10), ptr %"args::Any[]", i32 0
  %1 = load ptr addrspace(10), ptr %0, align 8, !tbaa !30, !invariant.load !0, !alias.scope !32, !noalias !35, !nonnull !0, !dereferenceable !70, !align !69
  %2 = addrspacecast ptr addrspace(10) %1 to ptr addrspace(11)
  %3 = getelementptr inbounds ptr addrspace(10), ptr %"args::Any[]", i32 1
  %4 = load ptr addrspace(10), ptr %3, align 8, !tbaa !30, !invariant.load !0, !alias.scope !32, !noalias !35, !nonnull !0, !dereferenceable !69, !align !69
  %5 = addrspacecast ptr addrspace(10) %4 to ptr addrspace(11)
  %6 = load i64, ptr addrspace(11) %5, align 8
  call swiftcc void @julia_show_18(ptr nonnull swiftself %pgcstack, ptr addrspace(11) nocapture readonly %2, i64 signext %6)
  %jl_nothing = load ptr, ptr @jl_nothing, align 8, !tbaa !30, !invariant.load !0, !alias.scope !32, !noalias !35, !nonnull !0
  %7 = addrspacecast ptr %jl_nothing to ptr addrspace(10)
  ret ptr addrspace(10) %7
}

declare ptr @julia.get_pgcstack()

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare void @llvm.dbg.declare(metadata, metadata, metadata) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare void @llvm.dbg.value(metadata, metadata, metadata) #2

; Function Attrs: memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @julia.safepoint(ptr) #3

declare swiftcc nonnull ptr addrspace(10) @"jlsys_#string#524_0"(ptr nonnull swiftself, i64 signext, i64 signext, i64 signext) #4

declare token @llvm.julia.gc_preserve_begin(...)

; Function Attrs: nounwind memory(none)
declare nonnull ptr @julia.pointer_from_objref(ptr addrspace(11)) #5

declare swiftcc i64 @jlsys_unsafe_write_1(ptr nonnull swiftself, ptr addrspace(10), i64 zeroext, i64 zeroext) #6

declare void @llvm.julia.gc_preserve_end(token)

attributes #0 = { "frame-pointer"="all" "julia.fsig"="show(Base.IOContext{Base.PipeEndpoint}, Int64)" "probe-stack"="inline-asm" }
attributes #1 = { noinline optnone "frame-pointer"="all" "probe-stack"="inline-asm" }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { memory(argmem: readwrite, inaccessiblemem: readwrite) }
attributes #4 = { "frame-pointer"="all" "julia.fsig"="var\22#string#524\22(Int64, Int64, typeof(Base.string), Int64)" "probe-stack"="inline-asm" }
attributes #5 = { nounwind memory(none) }
attributes #6 = { "frame-pointer"="all" "julia.fsig"="unsafe_write(Base.PipeEndpoint, Ptr{UInt8}, UInt64)" "probe-stack"="inline-asm" }

!llvm.module.flags = !{!1, !2, !3, !4, !5}
!llvm.dbg.cu = !{!6}

!0 = !{}
!1 = !{i32 2, !"Dwarf Version", i32 4}
!2 = !{i32 2, !"Debug Info Version", i32 3}
!3 = !{i32 2, !"julia.debug_level", i32 2}
!4 = !{i32 1, !"julia.__jit_debug_tsm_addr", i64 140730268203712}
!5 = !{i32 2, !"julia.optlevel", i32 2}
!6 = distinct !DICompileUnit(language: DW_LANG_Julia, file: !7, producer: "julia", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, nameTableKind: GNU)
!7 = !DIFile(filename: "julia", directory: ".")
!8 = distinct !DISubprogram(name: "show", linkageName: "julia_show_18", scope: null, file: !9, line: 1252, type: !10, scopeLine: 1252, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !6, retainedNodes: !21)
!9 = !DIFile(filename: "show.jl", directory: ".")
!10 = !DISubroutineType(types: !11)
!11 = !{!12, !13, !14, !20}
!12 = !DICompositeType(tag: DW_TAG_structure_type, name: "Nothing", align: 8, elements: !0, runtimeLang: DW_LANG_Julia, identifier: "139683472034064")
!13 = !DICompositeType(tag: DW_TAG_structure_type, name: "#show", align: 8, elements: !0, runtimeLang: DW_LANG_Julia, identifier: "139683449316672")
!14 = !DICompositeType(tag: DW_TAG_structure_type, name: "IOContext", size: 128, align: 64, elements: !15, runtimeLang: DW_LANG_Julia, identifier: "139683438866608")
!15 = !{!16, !16}
!16 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !17, size: 64, align: 64)
!17 = !DICompositeType(tag: DW_TAG_structure_type, name: "jl_value_t", file: !18, line: 71, align: 64, elements: !19)
!18 = !DIFile(filename: "julia.h", directory: "")
!19 = !{!16}
!20 = !DIBasicType(name: "Int64", size: 64, encoding: DW_ATE_unsigned)
!21 = !{!22, !23, !24}
!22 = !DILocalVariable(name: "#self#", arg: 1, scope: !8, file: !9, line: 1252, type: !13)
!23 = !DILocalVariable(name: "io", arg: 2, scope: !8, file: !9, line: 1252, type: !14)
!24 = !DILocalVariable(name: "n", arg: 3, scope: !8, file: !9, line: 1252, type: !20)
!25 = !DILocation(line: 1252, scope: !8)
!26 = !{!27, !27, i64 0}
!27 = !{!"jtbaa_gcframe", !28, i64 0}
!28 = !{!"jtbaa", !29, i64 0}
!29 = !{!"jtbaa"}
!30 = !{!31, !31, i64 0, i64 1}
!31 = !{!"jtbaa_const", !28, i64 0}
!32 = !{!33}
!33 = !{!"jnoalias_const", !34}
!34 = !{!"jnoalias"}
!35 = !{!36, !37, !38, !39}
!36 = !{!"jnoalias_gcframe", !34}
!37 = !{!"jnoalias_stack", !34}
!38 = !{!"jnoalias_data", !34}
!39 = !{!"jnoalias_typemd", !34}
!40 = !DILocation(line: 919, scope: !41, inlinedAt: !25)
!41 = distinct !DISubprogram(name: "string;", linkageName: "string", scope: !42, file: !42, type: !43, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !6, retainedNodes: !0)
!42 = !DIFile(filename: "intfuncs.jl", directory: ".")
!43 = !DISubroutineType(types: !0)
!44 = !DILocation(line: 248, scope: !45, inlinedAt: !25)
!45 = distinct !DISubprogram(name: "write;", linkageName: "write", scope: !46, file: !46, type: !43, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !6, retainedNodes: !0)
!46 = !DIFile(filename: "strings/io.jl", directory: ".")
!47 = !DILocation(line: 62, scope: !48, inlinedAt: !50)
!48 = distinct !DISubprogram(name: "unsafe_convert;", linkageName: "unsafe_convert", scope: !49, file: !49, type: !43, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !6, retainedNodes: !0)
!49 = !DIFile(filename: "pointer.jl", directory: ".")
!50 = !DILocation(line: 130, scope: !51, inlinedAt: !44)
!51 = distinct !DISubprogram(name: "pointer;", linkageName: "pointer", scope: !52, file: !52, type: !43, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !6, retainedNodes: !0)
!52 = !DIFile(filename: "strings/string.jl", directory: ".")
!53 = !DILocation(line: 297, scope: !54, inlinedAt: !44)
!54 = distinct !DISubprogram(name: "sizeof;", linkageName: "sizeof", scope: !55, file: !55, type: !43, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !6, retainedNodes: !0)
!55 = !DIFile(filename: "Base.jl", directory: ".")
!56 = !{i64 0, i64 9223372036854775807}
!57 = !DILocation(line: 705, scope: !58, inlinedAt: !44)
!58 = distinct !DISubprogram(name: "reinterpret;", linkageName: "reinterpret", scope: !59, file: !59, type: !43, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !6, retainedNodes: !0)
!59 = !DIFile(filename: "essentials.jl", directory: ".")
!60 = !DILocation(line: 435, scope: !61, inlinedAt: !63)
!61 = distinct !DISubprogram(name: "getproperty;", linkageName: "getproperty", scope: !62, file: !62, type: !43, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !6, retainedNodes: !0)
!62 = !DIFile(filename: "io.jl", directory: ".")
!63 = !DILocation(line: 415, scope: !64, inlinedAt: !65)
!64 = distinct !DISubprogram(name: "pipe_writer;", linkageName: "pipe_writer", scope: !9, file: !9, type: !43, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !6, retainedNodes: !0)
!65 = !DILocation(line: 450, scope: !66, inlinedAt: !44)
!66 = distinct !DISubprogram(name: "unsafe_write;", linkageName: "unsafe_write", scope: !62, file: !62, type: !43, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !6, retainedNodes: !0)
!67 = !DILocation(line: 439, scope: !61, inlinedAt: !63)
!68 = !{i64 72}
!69 = !{i64 8}
!70 = !{i64 16}
*** IR Dump Before BeforeOptimizationMarkerPass on [module] ***
; ModuleID = 'println'
source_filename = "println"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128-ni:10:11:12:13"
target triple = "x86_64-unknown-linux-gnu"

@jl_nothing = external constant ptr
@"*Core.getfield#29" = private unnamed_addr constant ptr inttoptr (i64 139683409598336 to ptr), !julia.constgv !0
@"*Main.Base.write#30" = private unnamed_addr constant ptr inttoptr (i64 139683422980656 to ptr), !julia.constgv !0

define swiftcc void @julia_println_27(ptr nonnull swiftself %pgcstack_arg, ptr addrspace(11) nocapture noundef nonnull readonly align 8 dereferenceable(16) %"io::IOContext") #0 !dbg !8 {
top:
  %pgcstack = call ptr @julia.get_pgcstack()
  %current_task = getelementptr inbounds ptr, ptr %pgcstack, i64 -14
  %world_age = getelementptr inbounds i64, ptr %current_task, i64 15
  call void @llvm.dbg.declare(metadata ptr addrspace(11) %"io::IOContext", metadata !22, metadata !DIExpression()), !dbg !23
  %current_task1 = getelementptr inbounds ptr, ptr %pgcstack, i64 -14
  %ptls_field = getelementptr inbounds ptr, ptr %current_task1, i64 16
  %ptls_load = load ptr, ptr %ptls_field, align 8, !tbaa !24
  %0 = getelementptr inbounds ptr, ptr %ptls_load, i64 2
  %safepoint = load ptr, ptr %0, align 8, !tbaa !28, !invariant.load !0
  fence syncscope("singlethread") seq_cst
  call void @julia.safepoint(ptr %safepoint), !dbg !23
  fence syncscope("singlethread") seq_cst
  br label %L2, !dbg !30

L2:                                               ; preds = %top
  br label %L3, !dbg !30

L3:                                               ; preds = %L2
  br label %L4, !dbg !30

L4:                                               ; preds = %L3
  br label %L5, !dbg !30

L5:                                               ; preds = %L4
  br label %L6, !dbg !30

L6:                                               ; preds = %L5
  br label %L7, !dbg !30

L7:                                               ; preds = %L6
  %"*Core.getfield#29" = load ptr, ptr @"*Core.getfield#29", align 8, !dbg !43, !tbaa !28, !invariant.load !0, !alias.scope !44, !noalias !47
  %1 = getelementptr inbounds ptr addrspace(10), ptr %"*Core.getfield#29", i64 0, !dbg !43
  %"io::IOContext.io_ptr" = getelementptr inbounds [2 x ptr addrspace(10)], ptr addrspace(11) %"io::IOContext", i32 0, i32 0, !dbg !43
  %"io::IOContext.io" = load atomic ptr addrspace(10), ptr addrspace(11) %"io::IOContext.io_ptr" unordered, align 8, !dbg !43, !tbaa !28, !invariant.load !0, !alias.scope !44, !noalias !47, !nonnull !0, !dereferenceable !52, !align !53
  br label %L9, !dbg !43

L9:                                               ; preds = %L7
  br label %L10, !dbg !43

L10:                                              ; preds = %L9
  %"*Main.Base.write#30" = load ptr, ptr @"*Main.Base.write#30", align 8, !dbg !37, !tbaa !28, !invariant.load !0, !alias.scope !44, !noalias !47
  %2 = getelementptr inbounds ptr addrspace(10), ptr %"*Main.Base.write#30", i64 0, !dbg !37
  %3 = call swiftcc i64 @jlsys_write_2(ptr nonnull swiftself %pgcstack, ptr addrspace(10) %"io::IOContext.io", i8 zeroext 10), !dbg !37
  br label %L12, !dbg !37

L12:                                              ; preds = %L10
  br label %L13, !dbg !54

L13:                                              ; preds = %L12
  br label %L14, !dbg !54

L14:                                              ; preds = %L13
  ret void, !dbg !54
}

; Function Attrs: noinline optnone
define nonnull ptr addrspace(10) @jfptr_println_28(ptr addrspace(10) %"function::Core.Function", ptr noalias nocapture noundef readonly %"args::Any[]", i32 %"nargs::UInt32") #1 {
top:
  %pgcstack = call ptr @julia.get_pgcstack()
  %0 = getelementptr inbounds ptr addrspace(10), ptr %"args::Any[]", i32 0
  %1 = load ptr addrspace(10), ptr %0, align 8, !tbaa !28, !invariant.load !0, !alias.scope !44, !noalias !47, !nonnull !0, !dereferenceable !55, !align !53
  %2 = addrspacecast ptr addrspace(10) %1 to ptr addrspace(11)
  call swiftcc void @julia_println_27(ptr nonnull swiftself %pgcstack, ptr addrspace(11) nocapture readonly %2)
  %jl_nothing = load ptr, ptr @jl_nothing, align 8, !tbaa !28, !invariant.load !0, !alias.scope !44, !noalias !47, !nonnull !0
  %3 = addrspacecast ptr %jl_nothing to ptr addrspace(10)
  ret ptr addrspace(10) %3
}

declare ptr @julia.get_pgcstack()

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare void @llvm.dbg.declare(metadata, metadata, metadata) #2

; Function Attrs: memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @julia.safepoint(ptr) #3

declare swiftcc i64 @jlsys_write_2(ptr nonnull swiftself, ptr addrspace(10), i8 zeroext) #4

attributes #0 = { "frame-pointer"="all" "julia.fsig"="println(Base.IOContext{Base.PipeEndpoint})" "probe-stack"="inline-asm" }
attributes #1 = { noinline optnone "frame-pointer"="all" "probe-stack"="inline-asm" }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { memory(argmem: readwrite, inaccessiblemem: readwrite) }
attributes #4 = { "frame-pointer"="all" "julia.fsig"="write(Base.PipeEndpoint, UInt8)" "probe-stack"="inline-asm" }

!llvm.module.flags = !{!1, !2, !3, !4, !5}
!llvm.dbg.cu = !{!6}

!0 = !{}
!1 = !{i32 2, !"Dwarf Version", i32 4}
!2 = !{i32 2, !"Debug Info Version", i32 3}
!3 = !{i32 2, !"julia.debug_level", i32 2}
!4 = !{i32 1, !"julia.__jit_debug_tsm_addr", i64 140730268203936}
!5 = !{i32 2, !"julia.optlevel", i32 2}
!6 = distinct !DICompileUnit(language: DW_LANG_Julia, file: !7, producer: "julia", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, nameTableKind: GNU)
!7 = !DIFile(filename: "julia", directory: ".")
!8 = distinct !DISubprogram(name: "println", linkageName: "julia_println_27", scope: null, file: !9, line: 5, type: !10, scopeLine: 5, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !6, retainedNodes: !20)
!9 = !DIFile(filename: "coreio.jl", directory: ".")
!10 = !DISubroutineType(types: !11)
!11 = !{!12, !13, !14}
!12 = !DICompositeType(tag: DW_TAG_structure_type, name: "Nothing", align: 8, elements: !0, runtimeLang: DW_LANG_Julia, identifier: "139683472034064")
!13 = !DICompositeType(tag: DW_TAG_structure_type, name: "#println", align: 8, elements: !0, runtimeLang: DW_LANG_Julia, identifier: "139683413212176")
!14 = !DICompositeType(tag: DW_TAG_structure_type, name: "IOContext", size: 128, align: 64, elements: !15, runtimeLang: DW_LANG_Julia, identifier: "139683438866608")
!15 = !{!16, !16}
!16 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !17, size: 64, align: 64)
!17 = !DICompositeType(tag: DW_TAG_structure_type, name: "jl_value_t", file: !18, line: 71, align: 64, elements: !19)
!18 = !DIFile(filename: "julia.h", directory: "")
!19 = !{!16}
!20 = !{!21, !22}
!21 = !DILocalVariable(name: "#self#", arg: 1, scope: !8, file: !9, line: 5, type: !13)
!22 = !DILocalVariable(name: "io", arg: 2, scope: !8, file: !9, line: 5, type: !14)
!23 = !DILocation(line: 5, scope: !8)
!24 = !{!25, !25, i64 0}
!25 = !{!"jtbaa_gcframe", !26, i64 0}
!26 = !{!"jtbaa", !27, i64 0}
!27 = !{!"jtbaa"}
!28 = !{!29, !29, i64 0, i64 1}
!29 = !{!"jtbaa_const", !26, i64 0}
!30 = !DILocation(line: 435, scope: !31, inlinedAt: !34)
!31 = distinct !DISubprogram(name: "getproperty;", linkageName: "getproperty", scope: !32, file: !32, type: !33, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !6, retainedNodes: !0)
!32 = !DIFile(filename: "io.jl", directory: ".")
!33 = !DISubroutineType(types: !0)
!34 = !DILocation(line: 415, scope: !35, inlinedAt: !37)
!35 = distinct !DISubprogram(name: "pipe_writer;", linkageName: "pipe_writer", scope: !36, file: !36, type: !33, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !6, retainedNodes: !0)
!36 = !DIFile(filename: "show.jl", directory: ".")
!37 = !DILocation(line: 448, scope: !38, inlinedAt: !39)
!38 = distinct !DISubprogram(name: "write;", linkageName: "write", scope: !32, file: !32, type: !33, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !6, retainedNodes: !0)
!39 = !DILocation(line: 867, scope: !38, inlinedAt: !40)
!40 = !DILocation(line: 252, scope: !41, inlinedAt: !23)
!41 = distinct !DISubprogram(name: "print;", linkageName: "print", scope: !42, file: !42, type: !33, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !6, retainedNodes: !0)
!42 = !DIFile(filename: "char.jl", directory: ".")
!43 = !DILocation(line: 439, scope: !31, inlinedAt: !34)
!44 = !{!45}
!45 = !{!"jnoalias_const", !46}
!46 = !{!"jnoalias"}
!47 = !{!48, !49, !50, !51}
!48 = !{!"jnoalias_gcframe", !46}
!49 = !{!"jnoalias_stack", !46}
!50 = !{!"jnoalias_data", !46}
!51 = !{!"jnoalias_typemd", !46}
!52 = !{i64 72}
!53 = !{i64 8}
!54 = !DILocation(line: 868, scope: !38, inlinedAt: !40)
!55 = !{i64 16}

The only mention I see of these tests failing is this comment #50275 (comment)

@maleadt
Copy link
Member

maleadt commented Mar 13, 2024

This is hitting 2 failures on test x86_64-linux-gnu and test x86_64-linux-gnuassertrr for which I don't see the link to this PR

Locally, using 1.10, this test behaves weirdly too. Grepping the output I see the int.jl:

JULIA_LLVM_ARGS=--print-before=BeforeOptimization julia +1.10 -g1 -E "@eval Int64(1)+Int64(1)" |& grep "int.jl"
!48 = !DIFile(filename: "int.jl", directory: ".")

However, if I run without the grep I don't see int.jl anywhere in the output. It looks like the int.jl-related debuginfo comes from an output-related function (julia_write_9) and not from the @eval?

@IanButterworth IanButterworth force-pushed the ib/precompilepkgs_precompile branch from 00512fb to 755616a Compare March 14, 2024 03:02
@IanButterworth
Copy link
Member Author

@vchuravy mentioned that those tests should maybe be moved to llvmpasses. I tried to figure out how to do that but couldn't, so I've skipped the problematic tests with a TODO. fyi @pchintalapudi

@IanButterworth IanButterworth added the merge me PR is reviewed. Merge when all tests are passing label Mar 14, 2024
test/cmdlineargs.jl Outdated Show resolved Hide resolved
test/cmdlineargs.jl Outdated Show resolved Hide resolved
@IanButterworth IanButterworth removed the merge me PR is reviewed. Merge when all tests are passing label Mar 14, 2024
@IanButterworth
Copy link
Member Author

Just double checked JLL stdlib load times

Master PR
Screenshot 2024-03-14 at 10 17 11 AM Screenshot 2024-03-14 at 10 17 29 AM

@IanButterworth IanButterworth merged commit c4ab0d4 into JuliaLang:master Mar 14, 2024
8 checks passed
@IanButterworth IanButterworth deleted the ib/precompilepkgs_precompile branch March 14, 2024 14:24
@IanButterworth IanButterworth added the backport 1.11 Change should be backported to release-1.11 label Mar 14, 2024
@KristofferC KristofferC mentioned this pull request Mar 15, 2024
60 tasks
IanButterworth added a commit that referenced this pull request Mar 16, 2024
- Bake precompilepkgs into the sysimage
- Enable compilation in stdlib JLLs @staticfloat I guess this is ok now
we have pkgimages?
- Add some hardcoded precompiles encountered locally
- Disable a problematic llvm test, with a note

With this there's no compilation loading Pkg in interactive mode
```
% ./julia --trace-compile=stderr --start=no -q
julia> ]
(@v1.12) pkg>
```

Before
```
% time julia +nightly --start=no --trace-compile=stderr -q -e "using Pkg"
precompile(Tuple{typeof(Base.setindex!), Base.Dict{Symbol, Union{Nothing, Bool, Int64, String}}, Int64, Symbol})
precompile(Tuple{typeof(Base.haskey), Base.Dict{String, Any}, String})
precompile(Tuple{typeof(MbedTLS_jll.__init__)})
precompile(Tuple{typeof(LibSSH2_jll.__init__)})
precompile(Tuple{typeof(LibGit2_jll.__init__)})
precompile(Tuple{typeof(nghttp2_jll.__init__)})
precompile(Tuple{typeof(LibCURL_jll.__init__)})
precompile(Tuple{typeof(MozillaCACerts_jll.__init__)})
precompile(Tuple{typeof(Base.Filesystem.normpath), String, String, Vararg{String}})
precompile(Tuple{typeof(p7zip_jll.__init__)})
precompile(Tuple{typeof(p7zip_jll.init_p7zip_path)})
precompile(Tuple{typeof(Base.append!), Array{String, 1}, Array{String, 1}})
precompile(Tuple{typeof(Base.join), Array{String, 1}, Char})
julia +nightly --start=no --trace-compile=stderr -q -e "using Pkg"  1.48s user 0.40s system 206% cpu 0.910 total
```
PR
```
% time ./julia --start=no --trace-compile=stderr -q -e "using Pkg"
./julia --start=no --trace-compile=stderr -q -e "using Pkg"  1.62s user 0.13s system 402% cpu 0.433 total
```

(cherry picked from commit c4ab0d4)
KristofferC added a commit that referenced this pull request Mar 17, 2024
Backported PRs:
- [x] #39071 <!-- Add a lazy `logrange` function and `LogRange` type -->
- [x] #51802 <!-- Allow AnnotatedStrings in log messages -->
- [x] #53369 <!-- Orthogonalize re-indexing for FastSubArrays -->
- [x] #48050 <!-- improve `--heap-size-hint` arg handling -->
- [x] #53482 <!-- add IR encoding for EnterNode -->
- [x] #53499 <!-- Avoid compiler warning about redefining jl_globalref_t
-->
- [x] #53507 <!-- update staled `Core.Compiler.Effects` documentation
-->
- [x] #53408 <!-- task splitting: change additive accumulation to
multiplicative -->
- [x] #53523 <!-- add back an alias for `check_top_bit` -->
- [x] #53377 <!-- add _readdirx for returning more object info gathered
during dir scan -->
- [x] #53525 <!-- fix InteractiveUtils call in Base.runtests on failure
-->
- [x] #53540 <!-- use more efficient `_readdirx` for tab completion -->
- [x] #53545 <!-- use `_readdirx` for `walkdir` -->
- [x] #53551 <!-- revert "Add @create_log_macro for making custom styled
logging macros (#52196)" -->
- [x] #53554 <!-- Always return a value in 1-d circshift! of
abstractarray.jl -->
- [x] #53424 <!-- yet more atomics & cache-line fixes on work-stealing
queue -->
- [x] #53571 <!-- Update Documenter to v1.3 for inventory writing -->
- [x] #53403 <!-- Move parallel precompilation to Base -->
- [x] #53589 <!-- add back `unsafe_convert` to pointer for arrays -->
- [x] #53596 <!-- build: remove extra .a file -->
- [x] #53606 <!-- fix error path in `precompilepkgs` -->
- [x] #53004 <!-- Unexport with, at_with, and ScopedValue from Base -->
- [x] #53629 <!-- typo fix in scoped values docs -->
- [x] #53630 <!-- sroa: Fix incorrect scope counting -->
- [x] #53598 <!-- Use Base parallel precompilation to build stdlibs -->
- [x] #53649 <!-- precompilepkgs: package in boths deps and weakdeps are
in fact only weak -->
- [x] #53671 <!-- Fix bootstrap Base precompile in cross compile
configuration -->
- [x] #52125 <!-- Load Pkg if not already to reinstate missing package
add prompt -->
- [x] #53602 <!-- Handle zero on arrays of unions of number types and
missings -->
- [x] #53516 <!-- permit NamedTuple{<:Any, Union{}} to be created -->
- [x] #53643 <!-- Bump CSL to 1.1.1 to fix libgomp bug -->
- [x] #53679 <!-- move precompile workload back from Base -->
- [x] #53663 <!-- add isassigned methods for reinterpretarray -->
- [x] #53662 <!-- [REPL] fix incorrectly cleared line after completions
accepted -->
- [x] #53611 <!-- Linalg: matprod_dest for Diagonal and adjvec -->
- [x] #53659 <!-- fix #52025, re-allow all implicit pointer casts in
cconvert for Array -->
- [x] #53631 <!-- LAPACK: validate input parameters to throw informative
errors -->
- [x] #53628 <!-- Make some improvements to the Scoped Values
documentation. -->
- [x] #53655 <!-- Change tbaa of ptr_phi to tbaa_value  -->
- [x] #53391 <!-- Default to the medium code model in x86 linux -->
- [x] #53699 <!-- Move `isexecutable, isreadable, iswritable` to
`filesystem.jl` -->
- [x] #41232 <!-- Fix linear indexing for ReshapedArray if the parent
has offset axes -->
- [x] #53527 <!-- Enable analyzegc checks for try catch and fix found
issues -->
- [x] #52092 
- [x] #53682 <!-- Increase build precompilation -->
- [x] #53720 
- [x] #53553 <!-- typeintersect: fix `UnionAll` unaliasing bug caused by
innervars. -->

Contains multiple commits, manual intervention needed:
- [ ] #53305 <!-- Propagate inbounds in isassigned with CartesianIndex
indices -->

Non-merged PRs with backport label:
- [ ] #53736 <!-- fix literal-pow to return the right type when the base
is -1 -->
- [ ] #53707 <!-- Make ScopedValue public -->
- [ ] #53696 <!-- add invokelatest to on_done callback in bracketed
paste -->
- [ ] #53660 <!-- put Logging back in default sysimage -->
- [ ] #53509 <!-- revert moving "creating packages" from Pkg.jl -->
- [ ] #53452 <!-- RFC: allow Tuple{Union{}}, returning Union{} -->
- [ ] #53402 <!-- Add `jl_getaffinity` and `jl_setaffinity` -->
- [ ] #52694 <!-- Reinstate similar for AbstractQ for backward
compatibility -->
- [ ] #51928 <!-- Styled markdown, with a few tweaks -->
- [ ] #51816 <!-- User-themable stacktraces -->
- [ ] #51811 <!-- Make banner size depend on terminal size -->
- [ ] #51479 <!-- prevent code loading from lookin in the versioned
environment when building Julia -->
@KristofferC KristofferC removed the backport 1.11 Change should be backported to release-1.11 label Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants