Thanks for using Compiler Explorer
Sponsors
Jakt
C++
Ada
Algol68
Analysis
Android Java
Android Kotlin
Assembly
C
C3
Carbon
C with Coccinelle
C++ with Coccinelle
C++ (Circle)
CIRCT
Clean
CMake
CMakeScript
COBOL
C++ for OpenCL
MLIR
Cppx
Cppx-Blue
Cppx-Gold
Cpp2-cppfront
Crystal
C#
CUDA C++
D
Dart
Elixir
Erlang
Fortran
F#
GLSL
Go
Haskell
HLSL
Hook
Hylo
IL
ispc
Java
Julia
Kotlin
LLVM IR
LLVM MIR
Modula-2
Mojo
Nim
Numba
Nix
Objective-C
Objective-C++
OCaml
Odin
OpenCL C
Pascal
Pony
PTX
Python
Racket
Raku
Ruby
Rust
Sail
Snowball
Scala
Slang
Solidity
Spice
SPIR-V
Swift
LLVM TableGen
Toit
Triton
TypeScript Native
V
Vala
Visual Basic
Vyper
WASM
Zig
Javascript
GIMPLE
Ygen
sway
llvm source #1
Output
Compile to binary object
Link to binary
Execute the code
Intel asm syntax
Demangle identifiers
Verbose demangling
Filters
Unused labels
Library functions
Directives
Comments
Horizontal whitespace
Debug intrinsics
Compiler
clang (assertions trunk)
clang (trunk)
clang 10.0.0
clang 10.0.1
clang 11.0.0
clang 11.0.1
clang 12.0.0
clang 12.0.1
clang 13.0.0
clang 14.0.0
clang 15.0.0
clang 16.0.0
clang 17.0.1
clang 18.1.0
clang 19.1.0
clang 20.1.0
clang 21.1.0
clang 4.0.1
clang 5.0.0
clang 6.0.0
clang 7.0.0
clang 8.0.0
clang 9.0.0
hexagon-clang 16.0.5
llc (assertions trunk)
llc (trunk)
llc 10.0.0
llc 10.0.1
llc 11.0.0
llc 11.0.1
llc 12.0.0
llc 12.0.1
llc 13.0.0
llc 14.0.0
llc 15.0.0
llc 16.0.0
llc 17.0.1
llc 18.1.0
llc 19.1.0
llc 20.1.0
llc 21.1.0
llc 3.2
llc 3.3
llc 3.9.1
llc 4.0.0
llc 4.0.1
llc 5.0.0
llc 6.0.0
llc 7.0.0
llc 8.0.0
llc 9.0.0
opt (assertions trunk)
opt (trunk)
opt 10.0.0
opt 10.0.1
opt 11.0.0
opt 11.0.1
opt 12.0.0
opt 12.0.1
opt 13.0.0
opt 14.0.0
opt 15.0.0
opt 16.0.0
opt 17.0.1
opt 18.1.0
opt 19.1.0
opt 20.1.0
opt 21.1.0
opt 3.2
opt 3.3
opt 3.9.1
opt 4.0.0
opt 4.0.1
opt 5.0.0
opt 6.0.0
opt 7.0.0
opt 8.0.0
opt 9.0.0
Options
Source code
; ModuleID = 'unopt.ll' source_filename = "foo2" 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 @"_j_str_typeassert#1" = private unnamed_addr constant [11 x i8] c"typeassert\00", align 1 @"+Main.Base.UUID#1006.jit" = private alias ptr, inttoptr (i64 131898060329968 to ptr) @"+Main.Base.PkgId#1011.jit" = private alias ptr, inttoptr (i64 131898060406656 to ptr) @"+Core.Nothing#1010.jit" = private alias ptr, inttoptr (i64 131898122715296 to ptr) @"jl_global#1009.jit" = private alias ptr, inttoptr (i64 131898230010352 to ptr) define swiftcc { ptr addrspace(10), i8 } @julia_foo2_1004(ptr noalias nocapture noundef nonnull align 8 dereferenceable(16) %union_bytes_return, ptr nonnull swiftself %pgcstack_arg) #0 !dbg !5 { top: %pgcstack = call ptr @julia.get_pgcstack() %ptls_field = getelementptr inbounds ptr, ptr %pgcstack, i64 2 %ptls_load = load ptr, ptr %ptls_field, align 8, !tbaa !17 %0 = getelementptr inbounds ptr, ptr %ptls_load, i64 2 %safepoint = load ptr, ptr %0, align 8, !tbaa !21, !invariant.load !14 fence syncscope("singlethread") seq_cst call void @julia.safepoint(ptr %safepoint), !dbg !23 fence syncscope("singlethread") seq_cst %1 = call swiftcc nonnull ptr addrspace(10) @j_identify_package_env_1008(ptr nonnull swiftself %pgcstack, ptr addrspace(10) addrspacecast (ptr @"jl_global#1009.jit" to ptr addrspace(10))), !dbg !24 %2 = call ptr addrspace(10) @julia.typeof(ptr addrspace(10) nonnull %1), !dbg !24 %3 = addrspacecast ptr addrspace(10) %2 to ptr addrspace(11), !dbg !24 %4 = call nonnull ptr @julia.pointer_from_objref(ptr addrspace(11) %3) #5, !dbg !24 %exactly_isa.not.not = icmp eq ptr %4, @"+Core.Nothing#1010.jit", !dbg !24 br i1 %exactly_isa.not.not, label %common.ret, label %guard_exit, !dbg !24 common.ret: ; preds = %top, %pass, %union_move11 %common.ret.op = phi { ptr addrspace(10), i8 } [ %13, %union_move11 ], [ %13, %pass ], [ { ptr addrspace(10) null, i8 1 }, %top ] ret { ptr addrspace(10), i8 } %common.ret.op, !dbg !29 guard_exit: ; preds = %top %5 = addrspacecast ptr addrspace(10) %1 to ptr addrspace(11), !dbg !30 %current_task21 = getelementptr inbounds ptr, ptr %pgcstack, i64 -14 %"box::PkgId" = call noalias nonnull align 8 dereferenceable(32) ptr addrspace(10) @julia.gc_alloc_obj(ptr nonnull %current_task21, i64 32, ptr addrspace(10) addrspacecast (ptr @"+Main.Base.PkgId#1011.jit" to ptr addrspace(10))) #10, !dbg !23 call void @llvm.memcpy.p10.p11.i64(ptr addrspace(10) noundef nonnull align 8 dereferenceable(32) %"box::PkgId", ptr addrspace(11) noundef align 8 dereferenceable(32) %5, i64 32, i1 false), !dbg !23, !tbaa !37, !alias.scope !41, !noalias !44 %6 = call nonnull ptr @julia.pointer_from_objref(ptr addrspace(11) addrspacecast (ptr @"+Main.Base.PkgId#1011.jit" to ptr addrspace(11))) #5, !dbg !49 %7 = addrspacecast ptr addrspace(10) %"box::PkgId" to ptr addrspace(11), !dbg !50 %8 = getelementptr inbounds { i64, i64, i8, ptr addrspace(10) }, ptr addrspace(11) %7, i64 0, i32 2, !dbg !50 %9 = load i8, ptr addrspace(11) %8, align 1, !dbg !50, !tbaa !53, !range !56, !alias.scope !57, !noalias !58 %exactly_isa5.not = icmp eq i8 %9, 0, !dbg !49 br i1 %exactly_isa5.not, label %post_box_union, label %pass, !dbg !49 post_box_union: ; preds = %guard_exit %jl_nothing = load ptr, ptr @jl_nothing, align 8, !dbg !49, !tbaa !21, !invariant.load !14, !alias.scope !59, !noalias !60, !nonnull !14 %10 = addrspacecast ptr %jl_nothing to ptr addrspace(12), !dbg !49 call void @ijl_type_error(ptr nonnull @"_j_str_typeassert#1", ptr addrspace(10) addrspacecast (ptr @"+Main.Base.UUID#1006.jit" to ptr addrspace(10)), ptr addrspace(12) %10), !dbg !49 unreachable, !dbg !49 pass: ; preds = %guard_exit call swiftcc void @j_println_1016(ptr nonnull swiftself %pgcstack, ptr addrspace(11) nocapture readonly %7), !dbg !49 %11 = load i8, ptr addrspace(11) %8, align 1, !dbg !61, !tbaa !53, !range !56, !alias.scope !57, !noalias !58 %12 = add nuw nsw i8 %11, 1, !dbg !61 %13 = insertvalue { ptr addrspace(10), i8 } { ptr addrspace(10) null, i8 undef }, i8 %12, 1, !dbg !61 %cond = icmp eq i8 %12, 2, !dbg !61 br i1 %cond, label %union_move11, label %common.ret, !dbg !61 union_move11: ; preds = %pass call void @llvm.memcpy.p0.p11.i64(ptr noundef nonnull align 8 dereferenceable(16) %union_bytes_return, ptr addrspace(11) noundef align 8 dereferenceable(16) %7, i64 16, i1 false), !dbg !61 br label %common.ret, !dbg !61 } declare ptr @julia.get_pgcstack() ; Function Attrs: nounwind willreturn allockind("alloc") allocsize(1) memory(argmem: read, inaccessiblemem: readwrite) declare noalias nonnull ptr addrspace(10) @julia.gc_alloc_obj(ptr, i64, ptr addrspace(10)) #1 ; Function Attrs: memory(argmem: readwrite, inaccessiblemem: readwrite) declare void @julia.safepoint(ptr) #2 declare swiftcc nonnull ptr addrspace(10) @j_identify_package_env_1008(ptr nonnull swiftself, ptr addrspace(10)) #3 ; Function Attrs: norecurse nounwind memory(none) declare nonnull ptr addrspace(10) @julia.typeof(ptr addrspace(10)) #4 ; Function Attrs: nounwind memory(none) declare nonnull ptr @julia.pointer_from_objref(ptr addrspace(11)) #5 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p10.p11.i64(ptr addrspace(10) noalias nocapture writeonly, ptr addrspace(11) noalias nocapture readonly, i64, i1 immarg) #6 ; Function Attrs: noreturn declare void @ijl_type_error(ptr, ptr addrspace(10), ptr addrspace(12)) #7 declare swiftcc void @j_println_1016(ptr nonnull swiftself, ptr addrspace(11) nocapture readonly) #8 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p11.i64(ptr noalias nocapture writeonly, ptr addrspace(11) noalias nocapture readonly, i64, i1 immarg) #6 ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #9 ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #9 attributes #0 = { "frame-pointer"="all" "julia.fsig"="foo2()" "probe-stack"="inline-asm" } attributes #1 = { nounwind willreturn allockind("alloc") allocsize(1) memory(argmem: read, inaccessiblemem: readwrite) } attributes #2 = { memory(argmem: readwrite, inaccessiblemem: readwrite) } attributes #3 = { "frame-pointer"="all" "julia.fsig"="identify_package_env(String)" "probe-stack"="inline-asm" } attributes #4 = { norecurse nounwind memory(none) } attributes #5 = { nounwind memory(none) } attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #7 = { noreturn } attributes #8 = { "frame-pointer"="all" "julia.fsig"="println(Base.UUID)" "probe-stack"="inline-asm" } attributes #9 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #10 = { nounwind willreturn allockind("alloc,uninitialized") allocsize(1) memory(argmem: read, inaccessiblemem: readwrite) } !llvm.module.flags = !{!0, !1, !2} !llvm.dbg.cu = !{!3} !0 = !{i32 2, !"Dwarf Version", i32 4} !1 = !{i32 2, !"Debug Info Version", i32 3} !2 = !{i32 2, !"julia.debug_level", i32 2} !3 = distinct !DICompileUnit(language: DW_LANG_Julia, file: !4, producer: "julia", isOptimized: true, runtimeVersion: 0, emissionKind: NoDebug, nameTableKind: GNU) !4 = !DIFile(filename: "julia", directory: ".") !5 = distinct !DISubprogram(name: "foo2", linkageName: "julia_foo2_1004", scope: null, file: !6, line: 1, type: !7, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !3, retainedNodes: !15) !6 = !DIFile(filename: "REPL[2]", directory: ".") !7 = !DISubroutineType(types: !8) !8 = !{!9, !13} !9 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !10, size: 64, align: 64) !10 = !DICompositeType(tag: DW_TAG_structure_type, name: "jl_value_t", file: !11, line: 71, align: 64, elements: !12) !11 = !DIFile(filename: "julia.h", directory: "") !12 = !{!9} !13 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "#foo2", align: 8, elements: !14, runtimeLang: DW_LANG_Julia, identifier: "131898226055504") !14 = !{} !15 = !{!16} !16 = !DILocalVariable(name: "#self#", arg: 2, scope: !5, file: !6, line: 1, type: !13) !17 = !{!18, !18, i64 0} !18 = !{!"jtbaa_gcframe", !19, i64 0} !19 = !{!"jtbaa", !20, i64 0} !20 = !{!"jtbaa"} !21 = !{!22, !22, i64 0, i64 1} !22 = !{!"jtbaa_const", !19, i64 0} !23 = !DILocation(line: 1, scope: !5) !24 = !DILocation(line: 391, scope: !25, inlinedAt: !28) !25 = distinct !DISubprogram(name: "identify_package;", linkageName: "identify_package", scope: !26, file: !26, type: !27, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !3) !26 = !DIFile(filename: "loading.jl", directory: ".") !27 = !DISubroutineType(types: !14) !28 = !DILocation(line: 2, scope: !5) !29 = !DILocation(line: 0, scope: !5) !30 = !DILocation(line: 31, scope: !31, inlinedAt: !33) !31 = distinct !DISubprogram(name: "getindex;", linkageName: "getindex", scope: !32, file: !32, type: !27, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !3) !32 = !DIFile(filename: "tuple.jl", directory: ".") !33 = !DILocation(line: 265, scope: !34, inlinedAt: !35) !34 = distinct !DISubprogram(name: "first;", linkageName: "first", scope: !32, file: !32, type: !27, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !3) !35 = !DILocation(line: 362, scope: !36, inlinedAt: !24) !36 = distinct !DISubprogram(name: "_nothing_or_first;", linkageName: "_nothing_or_first", scope: !26, file: !26, type: !27, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !3) !37 = !{!38, !38, i64 0} !38 = !{!"jtbaa_immut", !39, i64 0} !39 = !{!"jtbaa_value", !40, i64 0} !40 = !{!"jtbaa_data", !19, i64 0} !41 = !{!42} !42 = !{!"jnoalias_data", !43} !43 = !{!"jnoalias"} !44 = !{!45, !46, !47, !48} !45 = !{!"jnoalias_gcframe", !43} !46 = !{!"jnoalias_stack", !43} !47 = !{!"jnoalias_typemd", !43} !48 = !{!"jnoalias_const", !43} !49 = !DILocation(line: 5, scope: !5) !50 = !DILocation(line: 49, scope: !51, inlinedAt: !49) !51 = distinct !DISubprogram(name: "getproperty;", linkageName: "getproperty", scope: !52, file: !52, type: !27, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !3) !52 = !DIFile(filename: "Base.jl", directory: ".") !53 = !{!54, !54, i64 0} !54 = !{!"jtbaa_unionselbyte", !55, i64 0} !55 = !{!"jtbaa_stack", !19, i64 0} !56 = !{i8 0, i8 2} !57 = !{!46} !58 = !{!45, !42, !47, !48} !59 = !{!48} !60 = !{!45, !46, !42, !47} !61 = !DILocation(line: 49, scope: !51, inlinedAt: !62) !62 = !DILocation(line: 6, scope: !5)
Become a Patron
Sponsor on GitHub
Donate via PayPal
Compiler Explorer Shop
Source on GitHub
Mailing list
Installed libraries
Wiki
Report an issue
How it works
Contact the author
CE on Mastodon
CE on Bluesky
Statistics
Changelog
Version tree