Thanks for using Compiler Explorer
Sponsors
Jakt
C++
Ada
Analysis
Android Java
Android Kotlin
Assembly
C
C3
Carbon
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
Nim
Objective-C
Objective-C++
OCaml
OpenCL C
Pascal
Pony
Python
Racket
Ruby
Rust
Snowball
Scala
Solidity
Spice
SPIR-V
Swift
LLVM TableGen
Toit
TypeScript Native
V
Vala
Visual Basic
WASM
Zig
Javascript
GIMPLE
Ygen
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 4.0.1
clang 5.0.0
clang 6.0.0
clang 7.0.0
clang 8.0.0
clang 9.0.0
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 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 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 = '<source>' source_filename = "<source>" target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" target triple = "aarch64-unknown-linux-gnu" ; Function Attrs: mustprogress uwtable vscale_range(1,16) define dso_local noundef i32 @_Z4funciiii(i32 noundef %x, i32 noundef %a, i32 noundef %b, i32 noundef %c) #0 { entry: %retval = alloca i32, align 4 %x.addr = alloca i32, align 4 %a.addr = alloca i32, align 4 %b.addr = alloca i32, align 4 %c.addr = alloca i32, align 4 %d = alloca ptr, align 8 %cleanup.dest.slot = alloca i32, align 4 store i32 %x, ptr %x.addr, align 4, !tbaa !7 store i32 %a, ptr %a.addr, align 4, !tbaa !7 store i32 %b, ptr %b.addr, align 4, !tbaa !7 store i32 %c, ptr %c.addr, align 4, !tbaa !7 call void @llvm.lifetime.start.p0(i64 8, ptr %d) #3 %0 = load i32, ptr %c.addr, align 4, !tbaa !7 %call = call noundef ptr @_Z10createTypei(i32 noundef %0) store ptr %call, ptr %d, align 8, !tbaa !11 %1 = load i32, ptr %x.addr, align 4, !tbaa !7 %rem = srem i32 %1, 1000 %cmp = icmp eq i32 %rem, 0 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %2 = load ptr, ptr %d, align 8, !tbaa !11 %3 = load i32, ptr %a.addr, align 4, !tbaa !7 %4 = load i32, ptr %b.addr, align 4, !tbaa !7 %vtable = load ptr, ptr %2, align 8, !tbaa !13 %vfn = getelementptr inbounds ptr, ptr %vtable, i64 1 %5 = load ptr, ptr %vfn, align 8 %call1 = call noundef i32 %5(ptr noundef nonnull align 8 dereferenceable(8) %2, i32 noundef %3, i32 noundef %4) store i32 %call1, ptr %retval, align 4 store i32 1, ptr %cleanup.dest.slot, align 4 br label %cleanup if.end: ; preds = %entry %6 = load ptr, ptr %d, align 8, !tbaa !11 %7 = load i32, ptr %a.addr, align 4, !tbaa !7 %8 = load i32, ptr %b.addr, align 4, !tbaa !7 %vtable2 = load ptr, ptr %6, align 8, !tbaa !13 %vfn3 = getelementptr inbounds ptr, ptr %vtable2, i64 2 %9 = load ptr, ptr %vfn3, align 8 %call4 = call noundef i32 %9(ptr noundef nonnull align 8 dereferenceable(8) %6, i32 noundef %7, i32 noundef %8) store i32 %call4, ptr %retval, align 4 store i32 1, ptr %cleanup.dest.slot, align 4 br label %cleanup cleanup: ; preds = %if.end, %if.then call void @llvm.lifetime.end.p0(i64 8, ptr %d) #3 %10 = load i32, ptr %retval, align 4 ret i32 %10 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 declare noundef ptr @_Z10createTypei(i32 noundef) #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { mustprogress uwtable vscale_range(1,16) "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+aes,+bf16,+brbe,+crc,+crypto,+dotprod,+f32mm,+f64mm,+fp-armv8,+fp16fml,+fullfp16,+hbc,+i8mm,+ls64,+lse,+mops,+mte,+neon,+outline-atomics,+rand,+ras,+rcpc,+rdm,+sha2,+sha3,+sm4,+sme,+sme-f64f64,+sme-i16i64,+sme2,+spe,+sve,+sve2,+sve2-aes,+sve2-bitperm,+sve2-sha3,+sve2-sm4,+tme,+v8.1a,+v8.2a,+v8.3a,+v8.4a,+v8.5a,+v8.6a,+v8.7a,+v8.8a,+v8a,-fmv" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+aes,+bf16,+brbe,+crc,+crypto,+dotprod,+f32mm,+f64mm,+fp-armv8,+fp16fml,+fullfp16,+hbc,+i8mm,+ls64,+lse,+mops,+mte,+neon,+outline-atomics,+rand,+ras,+rcpc,+rdm,+sha2,+sha3,+sm4,+sme,+sme-f64f64,+sme-i16i64,+sme2,+spe,+sve,+sve2,+sve2-aes,+sve2-bitperm,+sve2-sha3,+sve2-sm4,+tme,+v8.1a,+v8.2a,+v8.3a,+v8.4a,+v8.5a,+v8.6a,+v8.7a,+v8.8a,+v8a,-fmv" } attributes #3 = { nounwind } !llvm.linker.options = !{} !llvm.module.flags = !{!0, !1, !2, !3, !4, !5} !llvm.ident = !{!6} !0 = !{i32 7, !"Dwarf Version", i32 4} !1 = !{i32 1, !"wchar_size", i32 4} !2 = !{i32 8, !"PIC Level", i32 2} !3 = !{i32 7, !"PIE Level", i32 2} !4 = !{i32 7, !"uwtable", i32 2} !5 = !{i32 7, !"frame-pointer", i32 1} !6 = !{!"clang version 17.0.0 (https://github.com/llvm/llvm-project.git 0acb639fd2350d831f149035e078654a655c209b)"} !7 = !{!8, !8, i64 0} !8 = !{!"int", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C++ TBAA"} !11 = !{!12, !12, i64 0} !12 = !{!"any pointer", !9, i64 0} !13 = !{!14, !14, i64 0} !14 = !{!"vtable pointer", !10, i64 0}
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
About the author
Statistics
Changelog
Version tree