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
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 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 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 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 = './example.ll' source_filename = "example.3a1fbbbh-cgu.0" target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" %"unwind::libunwind::_Unwind_Exception" = type { [0 x i64], i64, [0 x i64], void (i32, %"unwind::libunwind::_Unwind_Exception"*)*, [0 x i64], [6 x i64], [0 x i64] } %"unwind::libunwind::_Unwind_Context" = type { [0 x i8] } ; Function Attrs: nounwind nonlazybind uwtable define internal void @_ZN3std9panicking3try7do_call17h3bce190a8a612fbfE(i8* nocapture %data) unnamed_addr #0 { start: %0 = bitcast i8* %data to i32* tail call void @foo() store i32 42, i32* %0, align 4 ret void } ; Function Attrs: inlinehint nounwind nonlazybind uwtable define internal fastcc void @_ZN5alloc5alloc8box_free17h03ae124d78fd0527E(i8* nonnull %ptr.0, i64* noalias nocapture readonly align 8 dereferenceable(24) %ptr.1) unnamed_addr #1 { start: %0 = getelementptr inbounds i64, i64* %ptr.1, i64 1 %1 = load i64, i64* %0, align 8, !invariant.load !1 %2 = icmp eq i64 %1, 0 br i1 %2, label %bb7, label %bb4 bb4: ; preds = %start %3 = getelementptr inbounds i64, i64* %ptr.1, i64 2 %4 = load i64, i64* %3, align 8, !invariant.load !1 tail call void @__rust_dealloc(i8* nonnull %ptr.0, i64 %1, i64 %4) #3 br label %bb7 bb7: ; preds = %bb4, %start ret void } ; Function Attrs: nonlazybind uwtable define i32 @_ZN7example3bar17h22d7f146c3118b12E() unnamed_addr #2 personality i32 (i32, i32, i64, %"unwind::libunwind::_Unwind_Exception"*, %"unwind::libunwind::_Unwind_Context"*)* @rust_eh_personality { start: %data.i.i = alloca i32, align 4 %any_vtable.i.i = alloca i64, align 8 %any_data.i.i = alloca i64, align 8 %0 = bitcast i64* %any_data.i.i to i8* call void @llvm.lifetime.start.p0i8(i64 8, i8* nonnull %0), !noalias !2 store i64 0, i64* %any_data.i.i, align 8, !noalias !2 %1 = bitcast i64* %any_vtable.i.i to i8* call void @llvm.lifetime.start.p0i8(i64 8, i8* nonnull %1), !noalias !2 store i64 0, i64* %any_vtable.i.i, align 8, !noalias !2 %2 = bitcast i32* %data.i.i to i8* call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %2), !noalias !2 %3 = call i32 @__rust_maybe_catch_panic(void (i8*)* nonnull @_ZN3std9panicking3try7do_call17h3bce190a8a612fbfE, i8* nonnull %2, i64* nonnull %any_data.i.i, i64* nonnull %any_vtable.i.i), !noalias !2 %4 = icmp eq i32 %3, 0 br i1 %4, label %_ZN3std5panic12catch_unwind17h19eaab96d48c9410E.exit, label %bb2.i.i1 _ZN3std5panic12catch_unwind17h19eaab96d48c9410E.exit: ; preds = %start %5 = load i32, i32* %data.i.i, align 4, !noalias !2 call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %2), !noalias !2 call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %1), !noalias !2 call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %0), !noalias !2 br label %"_ZN4core6result19Result$LT$T$C$E$GT$9unwrap_or17hd512dca21f83b98fE.exit" bb2.i.i1: ; preds = %start %6 = call i64 @_ZN3std9panicking18update_panic_count17h82081ff04c7c13fdE(i64 -1), !noalias !2 %7 = bitcast i64* %any_data.i.i to {}** %8 = load {}*, {}** %7, align 8, !noalias !2, !nonnull !1 %9 = bitcast {}* %8 to i8* %10 = bitcast i64* %any_vtable.i.i to void ({}*)*** %11 = load void ({}*)**, void ({}*)*** %10, align 8, !noalias !2, !nonnull !1 call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %2), !noalias !2 call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %1), !noalias !2 call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %0), !noalias !2 %12 = load void ({}*)*, void ({}*)** %11, align 8, !invariant.load !1, !noalias !7, !nonnull !1 invoke void %12({}* nonnull align 1 %8) to label %bb3.i.i.i unwind label %cleanup.i.i.i, !noalias !7 bb3.i.i.i: ; preds = %bb2.i.i1 %13 = getelementptr inbounds void ({}*)*, void ({}*)** %11, i64 1 %14 = bitcast void ({}*)** %13 to i64* %15 = load i64, i64* %14, align 8, !invariant.load !1, !alias.scope !10, !noalias !7 %16 = icmp eq i64 %15, 0 br i1 %16, label %"_ZN4core6result19Result$LT$T$C$E$GT$9unwrap_or17hd512dca21f83b98fE.exit", label %bb4.i.i.i.i bb4.i.i.i.i: ; preds = %bb3.i.i.i %17 = getelementptr inbounds void ({}*)*, void ({}*)** %11, i64 2 %18 = bitcast void ({}*)** %17 to i64* %19 = load i64, i64* %18, align 8, !invariant.load !1, !alias.scope !10, !noalias !7 call void @__rust_dealloc(i8* nonnull %9, i64 %15, i64 %19) #3, !noalias !13 br label %"_ZN4core6result19Result$LT$T$C$E$GT$9unwrap_or17hd512dca21f83b98fE.exit" cleanup.i.i.i: ; preds = %bb2.i.i1 %20 = landingpad { i8*, i32 } cleanup %21 = bitcast void ({}*)** %11 to i64* call fastcc void @_ZN5alloc5alloc8box_free17h03ae124d78fd0527E(i8* nonnull %9, i64* noalias nonnull readonly align 8 dereferenceable(24) %21) #5, !noalias !7 resume { i8*, i32 } %20 "_ZN4core6result19Result$LT$T$C$E$GT$9unwrap_or17hd512dca21f83b98fE.exit": ; preds = %bb4.i.i.i.i, %bb3.i.i.i, %_ZN3std5panic12catch_unwind17h19eaab96d48c9410E.exit %22 = phi i32 [ 13, %bb3.i.i.i ], [ 13, %bb4.i.i.i.i ], [ %5, %_ZN3std5panic12catch_unwind17h19eaab96d48c9410E.exit ] ret i32 %22 } ; Function Attrs: nounwind nonlazybind uwtable declare i32 @rust_eh_personality(i32, i32, i64, %"unwind::libunwind::_Unwind_Exception"*, %"unwind::libunwind::_Unwind_Context"*) unnamed_addr #0 ; Function Attrs: nounwind nonlazybind uwtable declare i32 @__rust_maybe_catch_panic(void (i8*)* nonnull, i8*, i64*, i64*) unnamed_addr #0 ; Function Attrs: nonlazybind uwtable declare i64 @_ZN3std9panicking18update_panic_count17h82081ff04c7c13fdE(i64) unnamed_addr #2 ; Function Attrs: nounwind nonlazybind uwtable declare void @__rust_dealloc(i8*, i64, i64) unnamed_addr #0 ; Function Attrs: nounwind nonlazybind declare void @foo() unnamed_addr #3 ; Function Attrs: argmemonly nounwind willreturn declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #4 ; Function Attrs: argmemonly nounwind willreturn declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #4 attributes #0 = { nounwind nonlazybind uwtable "probe-stack"="__rust_probestack" "target-cpu"="x86-64" } attributes #1 = { inlinehint nounwind nonlazybind uwtable "probe-stack"="__rust_probestack" "target-cpu"="x86-64" } attributes #2 = { nonlazybind uwtable "probe-stack"="__rust_probestack" "target-cpu"="x86-64" } attributes #3 = { nounwind nonlazybind "target-cpu"="x86-64" } attributes #4 = { argmemonly nounwind willreturn } attributes #5 = { noinline } !llvm.module.flags = !{!0} !0 = !{i32 2, !"RtLibUseGOT", i32 1} !1 = !{} !2 = !{!3, !5} !3 = distinct !{!3, !4, !"_ZN3std9panicking3try17h6d8776eb3d3274c0E: argument 0"} !4 = distinct !{!4, !"_ZN3std9panicking3try17h6d8776eb3d3274c0E"} !5 = distinct !{!5, !6, !"_ZN3std5panic12catch_unwind17h19eaab96d48c9410E: argument 0"} !6 = distinct !{!6, !"_ZN3std5panic12catch_unwind17h19eaab96d48c9410E"} !7 = !{!8} !8 = distinct !{!8, !9, !"_ZN4core6result19Result$LT$T$C$E$GT$9unwrap_or17hd512dca21f83b98fE: %self"} !9 = distinct !{!9, !"_ZN4core6result19Result$LT$T$C$E$GT$9unwrap_or17hd512dca21f83b98fE"} !10 = !{!11} !11 = distinct !{!11, !12, !"_ZN5alloc5alloc8box_free17h03ae124d78fd0527E: %ptr.1"} !12 = distinct !{!12, !"_ZN5alloc5alloc8box_free17h03ae124d78fd0527E"} !13 = !{!11, !8}
Become a Patron
Sponsor on GitHub
Donate via PayPal
Source on GitHub
Mailing list
Installed libraries
Wiki
Report an issue
How it works
Contact the author
CE on Mastodon
CE on Bluesky
About the author
Statistics
Changelog
Version tree